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

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

Issue 2795623002: MD Bookmarks: Handle bookmark creation (Closed)
Patch Set: Created 3 years, 9 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
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 6e9c3dec69b29dcfc83b73d29710837b46e85e79..8cd94f5cb4c534988f757f5523e5777b0788b211 100644
--- a/chrome/test/data/webui/md_bookmarks/reducers_test.js
+++ b/chrome/test/data/webui/md_bookmarks/reducers_test.js
@@ -214,6 +214,20 @@ suite('node state', function() {
assertEquals(undefined, state['4'].url);
});
+ test('updates when a node is created', function() {
+ var node = {
+ id: '6',
+ parentId: '1',
+ index: 2,
+ };
+ action = bookmarks.actions.createBookmark(node.id, node);
+ state = bookmarks.NodeState.updateNodes(state, action);
+
+ assertEquals('1', state['6'].parentId);
+ assertDeepEquals([], state['6'].children);
+ assertDeepEquals(['2', '3', '6', '4'], state['1'].children);
+ });
calamity 2017/04/04 08:14:51 Can we also get a test for a folder creation?
tsergeant 2017/04/05 02:45:58 That one is a test for folder creation, but I've m
+
test('updates when a node is deleted', function() {
action = bookmarks.actions.removeBookmark('3', '1', 1);
state = bookmarks.NodeState.updateNodes(state, action);

Powered by Google App Engine
This is Rietveld 408576698