From 24355ff0a49f80e01974b1d9a511ffbc9a5a75df Mon Sep 17 00:00:00 2001 From: SebastianMC <23032356+SebastianMC@users.noreply.github.com> Date: Thu, 24 Aug 2023 00:35:19 +0200 Subject: [PATCH] Bugfix in sorterByMetadataField - reverse order working correctly now - fix in unit tests --- src/custom-sort/custom-sort.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/custom-sort/custom-sort.spec.ts b/src/custom-sort/custom-sort.spec.ts index b5ba6c6..92c6927 100644 --- a/src/custom-sort/custom-sort.spec.ts +++ b/src/custom-sort/custom-sort.spec.ts @@ -2235,7 +2235,7 @@ describe('CustomSortOrder.byMetadataFieldAlphabeticalReverse', () => { expect(result2).toBe(SORT_FIRST_GOES_LATER) expect(result3).toBe(SORT_ITEMS_ARE_EQUAL) }) - it('should put the item with metadata earlier if the second one has no metadata ', () => { + it('should put the item with metadata below the second one w/o metadata (this is reverse order)', () => { // given const itemA: Partial = { metadataFieldValue: '15', @@ -2251,8 +2251,8 @@ describe('CustomSortOrder.byMetadataFieldAlphabeticalReverse', () => { const result2: number = sorter(itemB as FolderItemForSorting, itemA as FolderItemForSorting) // then - expect(result1).toBe(SORT_FIRST_GOES_EARLIER) - expect(result2).toBe(SORT_FIRST_GOES_LATER) + expect(result1).toBe(SORT_FIRST_GOES_LATER) + expect(result2).toBe(SORT_FIRST_GOES_EARLIER) }) it('should correctly fallback to alphabetical reverse if no metadata on both items', () => { // given