fix(specs): Add regression test for list-selection

This commit is contained in:
Juan Tejada 2016-11-02 11:46:13 -07:00
parent d996273b7b
commit 13586d2886
2 changed files with 7 additions and 2 deletions

View file

@ -134,11 +134,16 @@ describe "ListSelection", ->
it "should throw an exception if the item passed is not a model", ->
expect( => @selection.expandTo('hi')).toThrow()
it "should select all items from the last selected item to the provided item", ->
it "should select all items from the last selected item to the provided item when the provided item is below the current selection", ->
@selection.set([@items[2], @items[5]])
@selection.expandTo(@items[8])
expect(@selection.ids()).toEqual(['2','5','6','7','8'])
it "should select all items from the last selected item to the provided item when the provided item is above the current selection", ->
@selection.set([@items[7], @items[5]])
@selection.expandTo(@items[2])
expect(@selection.ids()).toEqual(['7', '5', '4', '3', '2'])
it "should not do anything if the provided item is not in the view set", ->
@selection.set([@items[2]])
@selection.expandTo(new Thread(id:'not-in-view!'))

@ -1 +1 @@
Subproject commit 5365559d1452f018145af86dbbb3c8256bd75632
Subproject commit 7175c08bbd9a86643e271a5b7c520131de0c5d8b