Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed Dec 21, 2023
1 parent 477ad54 commit 15e3538
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/status_im/contexts/wallet/common/utils_test.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(ns status-im.contexts.wallet.common.utils-test
(:require [status-im.contexts.wallet.common.utils :as utils]
[cljs.test :refer-macros [deftest is testing]]))


(deftest test-extract-exponent
(testing "extract-exponent function"
(is (= (utils/extract-exponent "123.456") nil))
(is (= (utils/extract-exponent "2.5e-2") "2"))
(is (= (utils/extract-exponent "4.567e-10") "10"))))

(deftest test-calc-max-crypto-decimals
(testing "calc-max-crypto-decimals function"
(is (= (utils/calc-max-crypto-decimals 0.00323) 2))
(is (= (utils/calc-max-crypto-decimals 0.00123) 3))
(is (= (utils/calc-max-crypto-decimals 0.00000423) 5))
(is (= (utils/calc-max-crypto-decimals 1.23e-6) 6))
(is (= (utils/calc-max-crypto-decimals 1.13e-6) 7))))

0 comments on commit 15e3538

Please sign in to comment.