From be4190f9fbe5693df434bc90fb918b307ba2bd3f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 11:27:28 +0200 Subject: [PATCH 1/5] fix: Fix faux hierarchy reversal test Signed-off-by: Marcel Klehr --- src/test/test.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/test.js b/src/test/test.js index 2e1a49b59a..84007a3cc8 100644 --- a/src/test/test.js +++ b/src/test/test.js @@ -4052,19 +4052,22 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) console.log('First round ok') @@ -4124,7 +4127,8 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) console.log('Second round second half ok') @@ -4142,13 +4146,15 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + ignoreEmptyFolders(ACCOUNT_DATA), + false ) }) it('should handle complex move-remove interactions', async function() { From dd46926a2d34aae9c64559afe8e8fdbadeb6df21 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 12:13:31 +0200 Subject: [PATCH 2/5] chore(tests): Remove references to nextcloud-legacy Signed-off-by: Marcel Klehr --- src/test/test.js | 436 ++++++++++++++++++++++------------------------- 1 file changed, 208 insertions(+), 228 deletions(-) diff --git a/src/test/test.js b/src/test/test.js index 84007a3cc8..9eddb552d7 100644 --- a/src/test/test.js +++ b/src/test/test.js @@ -304,7 +304,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local changes', async function() { @@ -359,7 +359,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local removals', async function() { @@ -408,7 +408,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local folder moves', async function() { @@ -462,7 +462,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should create server bookmarks locally', async function() { @@ -508,7 +508,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update local bookmarks on server changes', async function() { @@ -570,7 +570,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update local bookmarks on server removals', async function() { @@ -621,7 +621,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should not delete additions while sync is running', async function() { @@ -680,7 +680,7 @@ describe('Floccus', function() { }), ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should be able to handle duplicates', async function() { @@ -732,7 +732,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should deduplicate unnormalized URLs', async function() { @@ -807,7 +807,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should deduplicate unnormalized URLs without getting stuck', async function() { @@ -869,7 +869,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should not fail when moving both folders and contents', async function() { @@ -924,23 +924,14 @@ describe('Floccus', function() { new Bookmark({ title: 'url', url: 'http://ur.l/' }), new Folder({ title: 'foo', - children: - ACCOUNT_DATA.type !== 'nextcloud-legacy' - ? [] - : [ - // This is because of a peculiarity of the legacy adapter - new Bookmark({ - title: 'test', - url: 'http://ureff.l/' - }) - ] + children: [], }), new Bookmark({ title: 'test', url: 'http://ureff.l/' }), ] }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should not fail when both moving folders and deleting their contents', async function() { @@ -1012,7 +1003,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle strange characters well', async function() { @@ -1062,7 +1053,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should be able to delete a server folder', async function() { @@ -1102,7 +1093,7 @@ describe('Floccus', function() { title: tree.title, children: [] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should be able to delete a local folder', async function() { @@ -1146,7 +1137,7 @@ describe('Floccus', function() { title: tree.title, children: [] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should be ok if both server and local bookmark are removed', async function() { @@ -1224,7 +1215,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const localTree = await account.localTree.getBookmarksTree(true) @@ -1242,7 +1233,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should move items successfully even into new folders', async function() { @@ -1300,7 +1291,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const localTree = await account.localTree.getBookmarksTree(true) @@ -1326,7 +1317,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should move items successfully when mixing creation and moving (1)', async function() { @@ -1398,7 +1389,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const localTree = await account.localTree.getBookmarksTree(true) @@ -1433,7 +1424,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should move items successfully when mixing creation and moving (2)', async function() { @@ -1522,7 +1513,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const localTree = await account.localTree.getBookmarksTree(true) @@ -1566,7 +1557,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should move items without creating a folder loop', async function() { @@ -1636,7 +1627,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const localTree = await account.localTree.getBookmarksTree(true) @@ -1644,7 +1635,7 @@ describe('Floccus', function() { expectTreeEqual( localTree, tree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should integrate existing items from both sides', async function() { @@ -1727,7 +1718,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA), + false, false /* checkOrder */ ) @@ -1757,7 +1748,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA), + false, false /* checkOrder */ ) @@ -1869,7 +1860,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) @@ -1896,7 +1887,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) }) @@ -1962,7 +1953,7 @@ describe('Floccus', function() { ]}), ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) expectTreeEqual( tree, @@ -1979,7 +1970,7 @@ describe('Floccus', function() { ]}), ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('initial sync done') @@ -2010,7 +2001,7 @@ describe('Floccus', function() { new Bookmark({title: '-----', url: 'https://separator.floccus.org/?id=379999'}) ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree = await getAllBookmarks(account) expectTreeEqual( @@ -2028,7 +2019,7 @@ describe('Floccus', function() { new Bookmark({title: '-----', url: 'https://separator.floccus.org/?id=467366'}) ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should sync separators 2', async function() { @@ -2093,7 +2084,7 @@ describe('Floccus', function() { ]}), ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) expectTreeEqual( tree, @@ -2110,7 +2101,7 @@ describe('Floccus', function() { ]}), ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('initial sync done') @@ -2138,7 +2129,7 @@ describe('Floccus', function() { ]}), ]}), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should sync root folder successfully', async function() { @@ -2175,7 +2166,7 @@ describe('Floccus', function() { expectTreeEqual( tree, newRoot, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) // Switch it back to something harmless, so we don't attempt to clean up the root folder @@ -2250,9 +2241,6 @@ describe('Floccus', function() { account = await Account.get(account.id) }) it('should synchronize ordering', async function() { - if (ACCOUNT_DATA.type === 'nextcloud-legacy') { - this.skip() - } if (ACCOUNT_DATA.noCache) { return this.skip() } @@ -2421,7 +2409,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it("shouldn't update the server on local removals", async function() { @@ -2457,7 +2445,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it("shouldn't update the server on local folder moves", async function() { @@ -2500,7 +2488,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should create server bookmarks locally', async function() { @@ -2545,7 +2533,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update local bookmarks on server changes', async function() { @@ -2607,7 +2595,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update local bookmarks on server removals', async function() { @@ -2654,7 +2642,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should sync root folder ignoring unsupported folders', async function() { @@ -2728,9 +2716,6 @@ describe('Floccus', function() { }) }) context('with overwrite mode', function() { - before(function() { - if (ACCOUNT_DATA.type === 'nextcloud-legacy') return this.skip() - }) it('should create local bookmarks on the server', async function() { await account.setData({ ...account.getData(), @@ -2776,7 +2761,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should create local bookmarks on the server respecting moves', async function() { @@ -2824,7 +2809,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const bazFolder = await browser.bookmarks.create({ @@ -2867,7 +2852,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local changes', async function() { @@ -2911,7 +2896,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local removals', async function() { @@ -2951,7 +2936,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server on local folder moves', async function() { @@ -2998,7 +2983,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it("shouldn't create server bookmarks locally", async function() { @@ -3031,7 +3016,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it("shouldn't update local bookmarks on server changes", async function() { @@ -3076,7 +3061,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it("shouldn't update local bookmarks on server removals", async function() { @@ -3115,7 +3100,7 @@ describe('Floccus', function() { expectTreeEqual( tree, originalTree, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) }) @@ -3278,7 +3263,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) const tree1AfterSyncing = await account1.localTree.getBookmarksTree( @@ -3290,13 +3275,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSyncing, tree2AfterSyncing, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterSyncing.title = serverTreeAfterSyncing.title expectTreeEqual( tree2AfterSyncing, serverTreeAfterSyncing, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should overtake moves to a different client', async function() { @@ -3329,19 +3314,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('First round ok') @@ -3363,13 +3348,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSecondSync, tree1BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterSecondSync.title = tree1AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree1AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round first half ok') @@ -3383,13 +3368,13 @@ describe('Floccus', function() { expectTreeEqual( tree2AfterThirdSync, tree1AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterThirdSync.title = tree2AfterThirdSync.title expectTreeEqual( serverTreeAfterThirdSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round second half ok') @@ -3404,13 +3389,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterThirdSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterThirdSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle creations inside deletions gracefully', async function() { @@ -3445,19 +3430,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('First round ok') @@ -3491,13 +3476,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterThirdSync, tree2BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterThirdSync.title = tree2BeforeSecondSync.title expectTreeEqual( serverTreeAfterThirdSync, tree2BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round second half ok') @@ -3514,13 +3499,13 @@ describe('Floccus', function() { expectTreeEqual( tree2AfterFinalSync, tree2BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2BeforeSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( serverTreeAfterFinalSync, tree2BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle duplicate bookmarks in different serverRoot folders', async function() { @@ -3592,12 +3577,12 @@ describe('Floccus', function() { expectTreeEqual( serverTree1, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) expectTreeEqual( tree2AfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle concurrent hierarchy reversals', async function() { @@ -3641,19 +3626,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('First round ok') @@ -3687,7 +3672,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round second half ok') @@ -3705,13 +3690,13 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle complex hierarchy reversals', async function() { @@ -3776,21 +3761,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) console.log('First round ok') @@ -3834,7 +3819,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) @@ -3853,14 +3838,14 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) }) @@ -3916,19 +3901,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('First round ok') @@ -3976,7 +3961,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round second half ok') @@ -3994,13 +3979,13 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should handle faux hierarchy reversals', async function() { @@ -4052,21 +4037,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) console.log('First round ok') @@ -4127,7 +4112,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) @@ -4146,14 +4131,14 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) }) @@ -4202,21 +4187,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) console.log('First round ok') @@ -4251,7 +4236,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) @@ -4270,19 +4255,18 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA), + false, false ) }) it('should synchronize ordering', async function() { - if (ACCOUNT_DATA.type === 'nextcloud-legacy') return this.skip() expect( (await getAllBookmarks(account1)).children ).to.have.lengthOf(0) @@ -4409,19 +4393,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('First round ok') @@ -4442,13 +4426,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSecondSync, tree1BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterSecondSync.title = tree1AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree1AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round first half ok') @@ -4470,13 +4454,13 @@ describe('Floccus', function() { expectTreeEqual( tree2AfterThirdSync, tree2BeforeThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterThirdSync.title = tree2AfterThirdSync.title expectTreeEqual( serverTreeAfterThirdSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round second half ok') @@ -4490,13 +4474,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterThirdSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterThirdSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) }) @@ -4594,7 +4578,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should create server bookmarks as tabs', async function() { @@ -4638,7 +4622,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update the server when pushing local changes', async function() { @@ -4676,7 +4660,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) await browser.tabs.update(tab.id, {url: 'https://example.org'}) @@ -4700,7 +4684,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) it('should update local tabs when pulling server changes', async function() { @@ -4744,7 +4728,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) let serverMark2 @@ -4781,7 +4765,7 @@ describe('Floccus', function() { }) ] }), - ignoreEmptyFolders(ACCOUNT_DATA) + false ) }) }) @@ -4954,19 +4938,19 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) } serverTreeAfterFirstSync = null @@ -4994,13 +4978,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSecondSync, tree1BeforeSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterSecondSync.title = tree1AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree1AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) } tree1BeforeSecondSync = null @@ -5019,13 +5003,13 @@ describe('Floccus', function() { expectTreeEqual( tree2AfterThirdSync, tree1AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterThirdSync.title = tree2AfterThirdSync.title expectTreeEqual( serverTreeAfterThirdSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) } serverTreeAfterThirdSync = null @@ -5044,13 +5028,13 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterThirdSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterThirdSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterThirdSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) } serverTreeAfterFinalSync = null @@ -5107,7 +5091,7 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') @@ -5115,14 +5099,14 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5148,14 +5132,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5181,14 +5165,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -5209,14 +5193,14 @@ describe('Floccus', function() { expectTreeEqual( tree2AfterSecondSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second local tree tree ok') serverTreeAfterSecondSync.title = tree2AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -5237,14 +5221,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -5267,14 +5251,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterInit, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') tree2AfterSecondSync.title = serverTreeAfterInit.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -5338,21 +5322,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5377,14 +5361,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5417,14 +5401,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -5447,7 +5431,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -5468,14 +5452,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -5498,14 +5482,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterInit, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') tree2AfterSecondSync.title = serverTreeAfterInit.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -5569,21 +5553,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5609,14 +5593,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5649,14 +5633,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -5684,7 +5668,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -5705,14 +5689,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -5734,14 +5718,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterInit, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -5803,21 +5787,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5846,14 +5830,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -5885,14 +5869,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -5918,7 +5902,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -5938,14 +5922,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -5966,14 +5950,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterInit, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -6053,21 +6037,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -6092,14 +6076,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -6132,14 +6116,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -6160,13 +6144,13 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterSecondSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterSecondSync.title = tree2AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -6187,14 +6171,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -6217,20 +6201,20 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree1AfterInit.title = serverTreeAfterSync.title expectTreeEqual( tree1AfterInit, serverTreeAfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') tree2AfterSecondSync.title = serverTreeAfterInit.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -6296,21 +6280,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: first tree ok') serverTreeAfterFirstSync.title = tree1Initial.title expectTreeEqual( serverTreeAfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: server tree ok') tree2AfterFirstSync.title = tree1Initial.title expectTreeEqual( tree2AfterFirstSync, tree1Initial, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -6336,14 +6320,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('first tree ok') tree2AfterFirstSync.title = serverTreeAfterFirstSync.title expectTreeEqual( tree2AfterFirstSync, serverTreeAfterFirstSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Initial round: second tree ok') } @@ -6377,14 +6361,14 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterSync, tree1BeforeSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: local tree tree ok') serverTreeAfterSync.title = tree1AfterSync.title expectTreeEqual( serverTreeAfterSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: server tree tree ok') } @@ -6410,13 +6394,13 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterSecondSync, serverTreeAfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) serverTreeAfterSecondSync.title = tree2AfterSecondSync.title expectTreeEqual( serverTreeAfterSecondSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Second round: second server tree tree ok') } @@ -6438,26 +6422,26 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFinalSync, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterSecondSync.title = tree1AfterFinalSync.title expectTreeEqual( tree1AfterFinalSync, tree2AfterSecondSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: local tree tree ok') serverTreeAfterSync.title = serverTreeAfterFinalSync.title expectTreeEqual( serverTreeAfterFinalSync, serverTreeAfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree2AfterSecondSync.title = serverTreeAfterFinalSync.title expectTreeEqual( tree2AfterSecondSync, serverTreeAfterFinalSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round: server tree tree ok') } @@ -6479,20 +6463,20 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterInit, serverTreeAfterInit, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) tree1AfterInit.title = tree1AfterSync.title expectTreeEqual( tree1AfterInit, tree1AfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: local tree ok') serverTreeAfterInit.title = serverTreeAfterSync.title expectTreeEqual( serverTreeAfterInit, serverTreeAfterSync, - ignoreEmptyFolders(ACCOUNT_DATA) + false ) console.log('Final round after init: server tree ok') } @@ -6511,10 +6495,6 @@ function hasNoBookmarks(child) { else return !child.children.some(child => !hasNoBookmarks(child)) } -function ignoreEmptyFolders(account_data) { - return account_data.type === 'nextcloud-legacy' -} - async function getAllBookmarks(account) { let tree await withSyncConnection(account, async() => { From 0c5ce6f5246c4ce9a48428d5c33728ef88777303 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 12:19:03 +0200 Subject: [PATCH 3/5] fix(tests): fix complex hierarchy reversals 2 test Signed-off-by: Marcel Klehr --- src/test/test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test.js b/src/test/test.js index 9eddb552d7..1421492db3 100644 --- a/src/test/test.js +++ b/src/test/test.js @@ -3901,18 +3901,21 @@ describe('Floccus', function() { expectTreeEqual( tree1AfterFirstSync, tree1, + false, false ) serverTreeAfterFirstSync.title = tree1.title expectTreeEqual( serverTreeAfterFirstSync, tree1, + false, false ) tree2AfterFirstSync.title = tree1.title expectTreeEqual( tree2AfterFirstSync, tree1, + false, false ) console.log('First round ok') @@ -3961,6 +3964,7 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterThirdSync, tree1AfterThirdSync, + false, false ) @@ -3979,12 +3983,14 @@ describe('Floccus', function() { expectTreeEqual( serverTreeAfterFinalSync, tree2AfterFinalSync, + false, false ) tree1AfterThirdSync.title = tree2AfterFinalSync.title expectTreeEqual( tree2AfterFinalSync, tree1AfterThirdSync, + false, false ) }) From 7c23c6760fc512d02e945bdc7d206a31ff209240 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 12:44:03 +0200 Subject: [PATCH 4/5] fix(SyncProcess#fromJSON): Fail if trees are not defined Signed-off-by: Marcel Klehr --- src/lib/Account.ts | 2 +- src/lib/strategies/Default.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/Account.ts b/src/lib/Account.ts index 49d1c90d83..3096de4bf4 100644 --- a/src/lib/Account.ts +++ b/src/lib/Account.ts @@ -202,7 +202,7 @@ export default class Account { mappings, localResource, this.server, - async (progress) => { + async(progress) => { if (!this.syncing) { return } diff --git a/src/lib/strategies/Default.ts b/src/lib/strategies/Default.ts index 4ddb795085..419082a474 100644 --- a/src/lib/strategies/Default.ts +++ b/src/lib/strategies/Default.ts @@ -64,12 +64,18 @@ export default class SyncProcess { setState({localTreeRoot, cacheTreeRoot, serverTreeRoot, localPlan, doneLocalPlan, serverPlan, doneServerPlan, serverReorderPlan, localReorderPlan, flagLocalPostMoveMapping, flagServerPostMoveMapping, flagPostReorderReconciliation}: any) { if (typeof localTreeRoot !== 'undefined') { this.localTreeRoot = Folder.hydrate(localTreeRoot) + } else { + throw new Error('No localTreeRoot found in continuation') } if (typeof cacheTreeRoot !== 'undefined') { this.cacheTreeRoot = Folder.hydrate(cacheTreeRoot) + } else { + throw new Error('No cacheTreeRoot found in continuation') } if (typeof serverTreeRoot !== 'undefined') { this.serverTreeRoot = Folder.hydrate(serverTreeRoot) + } else { + throw new Error('No serverTreeRoot found in continuation') } if (typeof localPlan !== 'undefined') { this.localPlan = Diff.fromJSON(localPlan) From fa2bb6a79f9ba7a7fdabcc8902b2049a19f65924 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 13:34:25 +0200 Subject: [PATCH 5/5] chore(ci): Move bookmarks app config to the end of the job name Signed-off-by: Marcel Klehr --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1298438219..a35643149d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -135,7 +135,7 @@ jobs: node-version: 14.x npm-version: 7.x - name: ${{ matrix.browsers }} bm@${{ matrix.app-version }} ${{matrix.floccus-adapter}}:${{ matrix.test-name}} + name: ${{ matrix.browsers }} ${{matrix.floccus-adapter}}:${{ matrix.test-name}} bm@${{ matrix.app-version }} services: hub: