| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 74 test('selects all valid IDs on highlight-items', function() { |
| 75 list.fire('highlight-items', ['10', '1', '3', '9']); |
| 76 assertEquals('select-items', store.lastAction.name); |
| 77 assertEquals('1', store.lastAction.anchor); |
| 78 assertDeepEquals(['1', '3'], store.lastAction.items); |
| 79 }); |
| 73 }); | 80 }); |
| 74 | 81 |
| 75 suite('<bookmarks-list> integration test', function() { | 82 suite('<bookmarks-list> integration test', function() { |
| 76 var list; | 83 var list; |
| 77 var store; | 84 var store; |
| 78 var items; | 85 var items; |
| 79 | 86 |
| 80 setup(function() { | 87 setup(function() { |
| 81 store = new bookmarks.TestStore({ | 88 store = new bookmarks.TestStore({ |
| 82 nodes: testTree(createFolder( | 89 nodes: testTree(createFolder( |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 assertDeepEquals( | 152 assertDeepEquals( |
| 146 ['1', '5', '7', '9'], normalizeSet(store.data.selection.items)); | 153 ['1', '5', '7', '9'], normalizeSet(store.data.selection.items)); |
| 147 assertDeepEquals('5', store.data.selection.anchor); | 154 assertDeepEquals('5', store.data.selection.anchor); |
| 148 | 155 |
| 149 customClick(items[0], {ctrlKey: true, shiftKey: true}); | 156 customClick(items[0], {ctrlKey: true, shiftKey: true}); |
| 150 assertDeepEquals( | 157 assertDeepEquals( |
| 151 ['1', '3', '5', '7', '9'], normalizeSet(store.data.selection.items)); | 158 ['1', '3', '5', '7', '9'], normalizeSet(store.data.selection.items)); |
| 152 assertDeepEquals('5', store.data.selection.anchor); | 159 assertDeepEquals('5', store.data.selection.anchor); |
| 153 }); | 160 }); |
| 154 }); | 161 }); |
| OLD | NEW |