
let test = require('zopf')
let mori = require('mori')
let proxyquire = require('proxyquire')

let sd = require('./skin-deeper')
let stubs = require('../stubs/react-stubs')

test('library', t => {
  t.case('LibraryPage', t => {
    let LibraryPage = proxyquire('../../app/components/library-page', stubs)
    sd.shallowRender(sd(LibraryPage, {}))
  })

  t.case('LibrarySidebar', t => {
    let LibrarySidebar = proxyquire('../../app/components/library-sidebar', stubs)
    let game = { title: 'Wreck IT' }
    let props = {
      collections: {
        a: {title: 'Collection A'},
        b: {title: 'Collection B'}
      },
      installs: {
        c: {task: 'download', progress: 0.2, game},
        d: {task: 'extract', progress: 0.7, game},
        e: {task: 'error', error: 'dun goofed', game},
        f: {task: 'idle', game}
      }
    }
    sd.shallowRender(sd(LibrarySidebar, {state: mori.toClj(props)}))
  })

  t.case('LibraryContent', t => {
    let LibraryContent = proxyquire('../../app/components/library-content', stubs)
    sd.shallowRender(sd(LibraryContent, {games: {}}))
  })

  t.case('LibraryPanelLink', t => {
    let LibraryPanelLink = proxyquire('../../app/components/library-panel-link', stubs)
    sd.shallowRender(sd(LibraryPanelLink, {}))
  })
})

@@ -827,16 +827,60 @@
 , game%7D%0A
+      %7D,%0A      library: %7B%0A        panel: ''%0A
       %7D%0A
@@ -1069,32 +1069,99 @@
 ontent', stubs)%0A
+    let props = %7B%0A      library: %7B%0A        panel: ''%0A      %7D%0A    %7D%0A
     sd.shallowRe
@@ -1185,16 +1185,42 @@
 ntent, %7B
+state: mori.toClj(props), 
 games: %7B

Make library specs pass