2023-07-07 14:16:50 +00:00
|
|
|
(ns utils.string-test
|
2023-10-16 22:03:18 +00:00
|
|
|
(:require
|
|
|
|
[cljs.test :refer [are deftest]]
|
|
|
|
utils.string))
|
2023-07-07 14:16:50 +00:00
|
|
|
|
|
|
|
(deftest get-initials-test
|
|
|
|
(are [expected input amount-initials]
|
|
|
|
(= expected (utils.string/get-initials input amount-initials))
|
|
|
|
"" nil 0
|
|
|
|
"" nil 1
|
|
|
|
"" "" 0
|
|
|
|
"" "ab" 0
|
|
|
|
"" "" 1
|
|
|
|
"A" "ab" 1
|
|
|
|
"A" " ab " 1
|
|
|
|
"A" "a b" 1
|
|
|
|
"A" "ab" 2
|
|
|
|
"AB" "a b" 2
|
|
|
|
"ABC" "a b c d" 3
|
|
|
|
"ABC" " a b c d" 3))
|