mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +08:00
Fix ModelViewSelection specs
This commit is contained in:
parent
6963d11491
commit
86077bfffd
1 changed files with 6 additions and 4 deletions
|
@ -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", ->
|
||||||
|
|
Loading…
Reference in a new issue