Chromium Code Reviews| 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); |