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

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

Issue 2813503002: MD Bookmarks: Prevent navigating to invalid folders (Closed)
Patch Set: handleAction -> dispatch Created 3 years, 8 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/types.js ('k') | chrome/test/data/webui/md_bookmarks/router_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_bookmarks/actions_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/actions_test.js b/chrome/test/data/webui/md_bookmarks/actions_test.js
index ccb8707e2f4e0184fb0db8dbd01e0b1492703c18..42c258e0313fc90b3428f4a70fb159d2daf6d07f 100644
--- a/chrome/test/data/webui/md_bookmarks/actions_test.js
+++ b/chrome/test/data/webui/md_bookmarks/actions_test.js
@@ -74,3 +74,22 @@ suite('selectItem', function() {
assertDeepEquals(['8'], action.items);
});
});
+
+test('selectFolder prevents selecting invalid nodes', function() {
+ var nodes = testTree(createFolder('1', [
+ createItem('2'),
+ ]));
+
+ var action = bookmarks.actions.selectFolder(ROOT_NODE_ID, nodes);
+ assertEquals(null, action);
+
+ action = bookmarks.actions.selectFolder('2', nodes);
+ assertEquals(null, action);
+
+ action = bookmarks.actions.selectFolder('42', nodes);
+ assertEquals(null, action);
+
+ action = bookmarks.actions.selectFolder('1', nodes);
+ assertEquals('select-folder', action.name);
+ assertEquals('1', action.id);
+});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/types.js ('k') | chrome/test/data/webui/md_bookmarks/router_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698