From 3c0cc70b03f94ff54312fc022f7e7ffe52e0815f Mon Sep 17 00:00:00 2001 From: SebastianMC <23032356+SebastianMC@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:50:42 +0200 Subject: [PATCH] #74 - Integration with Bookmarks core plugin and support for indirect drag & drop arrangement - adjusted behavior of by-bookmark-comparator to adhere to the multi-level sorting support implemented in #89 and merged recently to this branch. Basically, each comparator is responsible only for its own comparison and should no fallback into other default comparisons - instead it should return 0, which indicates item which are equal from the perspective of the comparator --- src/custom-sort/custom-sort.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/custom-sort/custom-sort.spec.ts b/src/custom-sort/custom-sort.spec.ts index 4c45993..a6a1d3d 100644 --- a/src/custom-sort/custom-sort.spec.ts +++ b/src/custom-sort/custom-sort.spec.ts @@ -2866,8 +2866,8 @@ describe('sorterByBookmarkOrder', () => { [true,3,undefined,-1, 'a','a'], [true,undefined,4,1, 'b','b'], [true,undefined,undefined,0, 'a','a'], - [true,undefined,undefined,-1, 'a','b'], - [true,undefined,undefined,1, 'd','c'], + [true,undefined,undefined,0, 'a','b'], + [true,undefined,undefined,0, 'd','c'], [false,10,20,1, 'a', 'a'], [false,20,10,-1, 'b', 'b'], [false,30,30,0, 'c', 'c'], // not possible in reality - each bookmark order is unique by definition - covered for clarity @@ -2876,8 +2876,8 @@ describe('sorterByBookmarkOrder', () => { [false,3,undefined,1, 'a','a'], [false,undefined,4,-1, 'b','b'], [false,undefined,undefined,0, 'a','a'], - [false,undefined,undefined,1, 'a','b'], - [false,undefined,undefined,-1, 'd','c'], + [false,undefined,undefined,0, 'a','b'], + [false,undefined,undefined,0, 'd','c'], ])('straight order %s, comparing %s and %s should return %s for sortStrings %s and %s', (straight: boolean, bookmarkA: number|undefined, bookmarkB: number|undefined, order: number, sortStringA: string, sortStringB) => {