unit tests for provider checks, provider listings, utils and provider meta

This commit is contained in:
mrjvs
2023-09-05 20:57:10 +02:00
parent 391432c1ba
commit bcf312d1b3
11 changed files with 476 additions and 61 deletions

View File

@@ -10,8 +10,8 @@ export function reorderOnIdList<T extends { rank: number; id: string }[]>(order:
// only one in order list
// negative means order [a,b]
// positive means order [b,a]
if (aIndex < 0) return 1; // A isnt in list, so A goes later on the list
if (bIndex < 0) return -1; // B isnt in list, so B goes later on the list
if (bIndex >= 0) return 1; // A isnt in list but B is, so A goes later on the list
if (aIndex >= 0) return -1; // B isnt in list but A is, so B goes later on the list
// both not in list, sort on rank
return b.rank - a.rank;