OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 suite('<bookmarks-list>', function() { | 5 suite('<bookmarks-list>', function() { |
6 var list; | 6 var list; |
7 var store; | 7 var store; |
8 | 8 |
9 setup(function() { | 9 setup(function() { |
10 store = new bookmarks.TestStore({ | 10 store = new bookmarks.TestStore({ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 assertEquals('select-items', store.lastAction.name); | 44 assertEquals('select-items', store.lastAction.name); |
45 assertFalse(store.lastAction.add); | 45 assertFalse(store.lastAction.add); |
46 assertEquals('1', store.lastAction.anchor); | 46 assertEquals('1', store.lastAction.anchor); |
47 assertDeepEquals(['1'], store.lastAction.items); | 47 assertDeepEquals(['1'], store.lastAction.items); |
48 | 48 |
49 store.data.selection.anchor = '1'; | 49 store.data.selection.anchor = '1'; |
50 customClick(items[2], {shiftKey: true, ctrlKey: true}); | 50 customClick(items[2], {shiftKey: true, ctrlKey: true}); |
51 | 51 |
52 assertEquals('select-items', store.lastAction.name); | 52 assertEquals('select-items', store.lastAction.name); |
53 assertTrue(store.lastAction.add); | 53 assertTrue(store.lastAction.add); |
54 assertEquals('5', store.lastAction.anchor); | 54 assertEquals('1', store.lastAction.anchor); |
55 assertDeepEquals(['1', '3', '5'], store.lastAction.items); | 55 assertDeepEquals(['1', '3', '5'], store.lastAction.items); |
56 }); | 56 }); |
57 | 57 |
58 test('deselects items on click outside of card', function() { | 58 test('deselects items on click outside of card', function() { |
59 customClick(list); | 59 customClick(list); |
60 assertEquals('deselect-items', store.lastAction.name); | 60 assertEquals('deselect-items', store.lastAction.name); |
61 }); | 61 }); |
62 | 62 |
63 test('adds, deletes, and moves update displayedList_', function() { | 63 test('adds, deletes, and moves update displayedList_', function() { |
64 list.displayedIds_ = ['1', '7', '3', '5']; | 64 list.displayedIds_ = ['1', '7', '3', '5']; |
65 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); | 65 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); |
66 | 66 |
67 list.displayedIds_ = ['1', '3', '5']; | 67 list.displayedIds_ = ['1', '3', '5']; |
68 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); | 68 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); |
69 | 69 |
70 list.displayedIds_ = ['1', '3', '7', '5']; | 70 list.displayedIds_ = ['1', '3', '7', '5']; |
71 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); | 71 assertDeepEquals(list.displayedIds_, list.displayedList_.map(n => n.id)); |
72 }); | 72 }); |
73 }); | 73 }); |
OLD | NEW |