fix: Sorting of Pagelinks in Query tables

This commit is contained in:
sallto
2022-10-20 17:32:23 +02:00
committed by Gabriel Horner
parent 584383f2c7
commit 2883bae097
2 changed files with 11 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ and handles unexpected failure."
"Normalizes supported formats such as dates and percentages."
([block]
(->> [normalize-as-percentage normalize-as-date identity]
(map #(% block))
(map #(% (if (set? block) (first block) block)))
(remove nil?)
(first))))

View File

@@ -9,6 +9,12 @@
"2022-08-12T00:00:00Z"
"2022-08-12T00:00:00Z"
"2022-08-12T00:00:00Z"
#{"Aug 12th, 2022"}
"2022-08-12T00:00:00Z"
#{"2022-08-12T00:00:00Z"}
"2022-08-12T00:00:00Z")))
(deftest test-normalize-percentage
@@ -21,7 +27,10 @@
0
"-5%"
-0.05)))
-0.05
#{"50%"}
0.5)))
(deftest test-random-values
(testing "random values should not be processed"