Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: chrome/test/data/webui/md_bookmarks/reducers_test.js

Issue 2946883002: MD Bookmarks: Deselect items when they are moved to a new folder (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_bookmarks/reducers_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/reducers_test.js b/chrome/test/data/webui/md_bookmarks/reducers_test.js
index a23c27ec08ea15f8ca3b27182a9b6b40876fe77b..15fae4d3f548592df6c48a2b4ba6569d50ea5cbe 100644
--- a/chrome/test/data/webui/md_bookmarks/reducers_test.js
+++ b/chrome/test/data/webui/md_bookmarks/reducers_test.js
@@ -106,16 +106,16 @@ suite('selection state', function() {
});
test('deselects items when they are deleted', function() {
- var nodeMap = testTree(createFolder('0', [
- createFolder(
- '1',
- [
- createItem('2'),
- createItem('3'),
- createItem('4'),
- ]),
- createItem('5'),
- ]));
+ var nodeMap = testTree(
+ createFolder(
+ '1',
+ [
+ createItem('2'),
+ createItem('3'),
+ createItem('4'),
+ ]),
+ createItem('5'),
+ );
action = select(['2', '4', '5'], '4', true, false);
selection = bookmarks.SelectionState.updateSelection(selection, action);
@@ -126,6 +126,24 @@ suite('selection state', function() {
assertDeepEquals(['5'], normalizeSet(selection.items));
assertEquals(null, selection.anchor);
});
+
+ test('deselects items when they are moved to a different folder', function() {
+ var nodeMap = testTree(
+ createFolder('1', []),
+ createItem('2'),
+ createItem('3'),
+ );
+
+ action = select(['2', '3'], '2', true, false);
+ selection = bookmarks.SelectionState.updateSelection(selection, action);
+
+ // Move item '2' from the 1st item in '0' to the 0th item in '1'.
+ action = bookmarks.actions.moveBookmark('2', '1', 0, '0', 1);
calamity 2017/06/22 05:35:34 I feel like we should have made these objects. It'
tsergeant 2017/06/22 06:59:09 Do you mean in general or just in this test? This
+ selection = bookmarks.SelectionState.updateSelection(selection, action);
+
+ assertDeepEquals(['3'], normalizeSet(selection.items));
+ assertEquals(null, selection.anchor);
+ });
});
suite('closed folder state', function() {
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698