Fix ModelViewSelection specs

This commit is contained in:
Ben Gotow 2016-01-11 13:47:34 -08:00
parent 6963d11491
commit 86077bfffd

View file

@ -7,14 +7,16 @@ ModelViewSelection = require '../src/flux/stores/model-view-selection'
describe "ModelViewSelection", -> describe "ModelViewSelection", ->
beforeEach -> beforeEach ->
@trigger = jasmine.createSpy('trigger') @trigger = jasmine.createSpy('trigger')
@items = [] @items = []
@items.push(new Thread(id: "#{ii}")) for ii in [0..99] @items.push(new Thread(id: "#{ii}")) for ii in [0..99]
@view = new ModelView() @view = new ModelView()
@view._pages = @view.indexOfId = jasmine.createSpy('indexOfId').andCallFake (id) =>
"0": _.findIndex(@items, _.matcher({id}))
items: @items @view.get = jasmine.createSpy('get').andCallFake (idx) =>
loaded: true @items[idx]
@selection = new ModelViewSelection(@view, @trigger) @selection = new ModelViewSelection(@view, @trigger)
it "should initialize with an empty set", -> it "should initialize with an empty set", ->