| 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-sidebar>', function() { | 5 suite('<bookmarks-sidebar>', function() { |
| 6 var sidebar; | 6 var sidebar; |
| 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 assertEquals('0', f.style.getPropertyValue('--node-depth')); | 63 assertEquals('0', f.style.getPropertyValue('--node-depth')); |
| 64 }); | 64 }); |
| 65 Array.prototype.forEach.call(firstGen, function(f) { | 65 Array.prototype.forEach.call(firstGen, function(f) { |
| 66 assertEquals(1, f.depth); | 66 assertEquals(1, f.depth); |
| 67 assertEquals('1', f.style.getPropertyValue('--node-depth')); | 67 assertEquals('1', f.style.getPropertyValue('--node-depth')); |
| 68 }); | 68 }); |
| 69 Array.prototype.forEach.call(secondGen, function(f) { | 69 Array.prototype.forEach.call(secondGen, function(f) { |
| 70 assertEquals(2, f.depth); | 70 assertEquals(2, f.depth); |
| 71 assertEquals('2', f.style.getPropertyValue('--node-depth')); | 71 assertEquals('2', f.style.getPropertyValue('--node-depth')); |
| 72 }); | 72 }); |
| 73 }) | 73 }); |
| 74 |
| 75 test('doesn\'t highlight selected folder while searching', function() { |
| 76 var rootFolders = |
| 77 sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node'); |
| 78 |
| 79 store.data.selectedFolder = '1'; |
| 80 store.notifyObservers(); |
| 81 |
| 82 assertEquals('1', rootFolders['0'].itemId); |
| 83 assertTrue(rootFolders['0'].isSelectedFolder_); |
| 84 |
| 85 store.data.search = { |
| 86 term: 'test', |
| 87 inProgress: false, |
| 88 results: ['3'], |
| 89 }; |
| 90 store.notifyObservers(); |
| 91 |
| 92 assertFalse(rootFolders['0'].isSelectedFolder_); |
| 93 }); |
| 74 }); | 94 }); |
| OLD | NEW |