move tests alongside their cljs counterpart

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2020-04-30 16:44:17 +02:00
parent d5ef218584
commit bf706e8fd2
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
64 changed files with 75 additions and 86 deletions

View File

@ -70,8 +70,7 @@
;; produced by the target :mocks below and redefines node require
;; function to use the mocks instead of the rn libraries
:test
{:ns-regexp "status-im.test."
:output-to "target/test/test.js"
{:output-to "target/test/test.js"
:output-dir "target/test"
:optimizations :simple
:target :node-test

View File

@ -1,4 +1,4 @@
(ns status-im.test.models.bootnode
(ns status-im.bootnode.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.bootnodes.core :as model]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.browser.core
(ns status-im.browser.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.browser.core :as browser]
[status-im.utils.http :as http]))

View File

@ -1,9 +1,9 @@
(ns status-im.test.browser.permissions
(ns status-im.browser.permissions-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.browser.permissions :as permissions]
[status-im.utils.types :as types]
[status-im.browser.core :as browser]
[status-im.test.browser.core :as core.tests]))
[status-im.browser.core-test :as core.tests]))
(deftest permissions-test
(let [dapp-name "test.com"

View File

@ -1,4 +1,4 @@
(ns status-im.test.chat.db
(ns status-im.chat.db-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.chat.models.input
(ns status-im.chat.models.input-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.chat.constants :as constants]
[status-im.utils.config :as config]

View File

@ -1,4 +1,4 @@
(ns status-im.test.chat.models.message-list
(ns status-im.chat.models.message-list-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.constants :as const]
[taoensso.tufte :as tufte :refer-macros (defnp p profiled profile)]

View File

@ -1,4 +1,4 @@
(ns status-im.test.chat.models.message
(ns status-im.chat.models.message-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.chat.models
(ns status-im.chat.models-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.models.contact
(ns status-im.contact.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.json-rpc :as json-rpc]
[status-im.utils.gfycat.core :as gfycat]

View File

@ -1,4 +1,4 @@
(ns status-im.test.contacts.db
(ns status-im.contacts.db-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.data-store.chats
(ns status-im.data-store.chats-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.random :as utils.random]
[status-im.data-store.chats :as chats]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.data-store.contacts
(ns status-im.data-store.contacts-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.data-store.contacts :as c]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.data-store.messages
(ns status-im.data-store.messages-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.data-store.messages :as m]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.abi-spec
(ns status-im.ethereum.abi-spec-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.abi-spec :as abi-spec]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.core
(ns status-im.ethereum.core-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.ethereum.core :as ethereum]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.eip55
(ns status-im.ethereum.eip55-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.ethereum.eip55 :as eip55]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.eip681
(ns status-im.ethereum.eip681-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.eip681 :as eip681]
[status-im.utils.money :as money]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.ens
(ns status-im.ethereum.ens-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.ens :as ens]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.mnemonic
(ns status-im.ethereum.mnemonic-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.mnemonic :as mnemonic]
[clojure.string :as string]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ethereum.stateofus
(ns status-im.ethereum.stateofus-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.stateofus :as stateofus]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.fleet.core
(ns status-im.fleet.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.constants :as constants]
[status-im.fleet.core :as fleet]

View File

@ -1,4 +1,4 @@
(ns status-im.test.hardwallet.common
(ns status-im.hardwallet.common-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.hardwallet.common :as common]))
@ -40,4 +40,3 @@
(common/show-connection-sheet
{:db {}}
{:on-card-connected :do-something})))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.hardwallet.core
(ns status-im.hardwallet.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.hardwallet.core :as hardwallet]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.i18n
(ns status-im.i18n-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.i18n :as i18n]
[status-im.i18n-resources :as i18n-resources]

View File

@ -1,4 +1,4 @@
(ns status-im.test.mailserver.core
(ns status-im.mailserver.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[clojure.string :as string]
[status-im.ethereum.json-rpc :as json-rpc]

View File

@ -1,4 +1,4 @@
(ns status-im.test.mailserver.topics
(ns status-im.mailserver.topics-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.transport.utils :as utils]
[status-im.mailserver.constants :as c]

View File

@ -1,4 +1,4 @@
(ns status-im.test.multiaccounts.login.core
(ns status-im.multiaccounts.login.core-test
(:require [cljs.test :as test]
[status-im.multiaccounts.login.core :as login]
[status-im.multiaccounts.biometric.core :as biometric]

View File

@ -1,4 +1,4 @@
(ns status-im.test.sign-in.data)
(ns status-im.multiaccount.login.data-test)
(def all-contacts
[{:last-updated 1547185503000

View File

@ -1,4 +1,4 @@
(ns status-im.test.sign-in.flow
(ns status-im.multiaccount.login.flow-test
"The main purpose of these tests is to signal that some steps of the sign in
flow has been changed. Such changes should be reflected in both these tests
and documents which describe the whole \"sign in\" flow."
@ -6,7 +6,7 @@
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.json-rpc :as json-rpc]
[status-im.multiaccounts.login.core :as login.core]
[status-im.test.sign-in.data :as data]))
[status-im.multiaccount.login.data-test :as data]))
(deftest on-password-input-submitted
(testing

View File

@ -1,4 +1,4 @@
(ns status-im.test.multiaccounts.model
(ns status-im.multiaccounts.model-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.multiaccounts.model :as multiaccounts.model]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.multiaccounts.recover.core
(ns status-im.multiaccounts.recover.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.multiaccounts.recover.core :as models]
[status-im.multiaccounts.create.core :as multiaccounts.create]

View File

@ -1,4 +1,4 @@
(ns status-im.test.multiaccounts.update.core
(ns status-im.multiaccounts.update.core-test
(:require [clojure.test :refer-macros [deftest is]]
[status-im.ethereum.json-rpc :as json-rpc]
[status-im.multiaccounts.update.core :as multiaccounts.update]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.network.core
(ns status-im.network.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ethereum.json-rpc :as json-rpc]
[status-im.network.core :as network.core]

View File

@ -1,4 +1,4 @@
(ns status-im.test.search.core
(ns status-im.search.core-test
(:require [cljs.test :refer-macros [deftest testing is]]
[status-im.subs :as search.subs]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.signing.core
(ns status-im.signing.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.signing.core :as signing]
[status-im.ethereum.abi-spec :as abi-spec]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.signing.gas
(ns status-im.signing.gas-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.signing.gas :as signing.gas]))
@ -35,4 +35,4 @@
(testing "it sets the value in number for gasi"
(is (= "21000" (str (get-in actual [:gas :value-number])))))
(testing "it calculates max-fee"
(is (= "0.00021" (:max-fee actual)))))))
(is (= "0.00021" (:max-fee actual)))))))

View File

@ -1,7 +1,7 @@
(ns status-im.test.stickers.core
(ns status-im.stickers.core-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.stickers.core :as stickers]))
(deftest valid-sticker?
(is (true? (stickers/valid-sticker? {:hash ""})))
(is (false? (stickers/valid-sticker? {}))))
(is (false? (stickers/valid-sticker? {}))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.wallet.transactions.subs
(ns status-im.subs-test
(:require [cljs.test :refer [deftest is testing]]
reagent.core
[re-frame.core :as re-frame]
@ -6,7 +6,7 @@
status-im.ui.screens.db
status-im.subs
[status-im.ui.screens.events :as events]
[status-im.subs :as transactions-subs]))
[status-im.subs :as subs]))
(def transactions [{:timestamp "1505912551000"}
{:timestamp "1505764322000"}
@ -24,5 +24,5 @@
(deftest group-transactions-by-date
"Check if transactions are sorted by date"
(is (= (transactions-subs/group-transactions-by-date transactions)
(is (= (subs/group-transactions-by-date transactions)
grouped-transactions)))

View File

@ -1,4 +1,4 @@
(ns status-im.test.transport.core
(ns status-im.transport.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.fx :as fx]
[status-im.protocol.core :as protocol]

View File

@ -1,4 +1,4 @@
(ns status-im.test.transport.filters.core
(ns status-im.transport.filters.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.fx :as fx]
[status-im.mailserver.topics :as mailserver.topics]

View File

@ -1,4 +1,4 @@
(ns status-im.test.tribute-to-talk.core
(ns status-im.tribute-to-talk.core-test
(:require [cljs.test :refer-macros [deftest testing is]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.tribute-to-talk.db
(ns status-im.tribute-to-talk.db-test
(:require [cljs.test :refer-macros [deftest testing is]]
[status-im.tribute-to-talk.db :as db]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.tribute-to-talk.whitelist
(ns status-im.tribute-to-talk.whitelist-test
(:require [cljs.test :refer-macros [deftest testing is]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.constants :as constants]

View File

@ -1,4 +1,4 @@
(ns status-im.test.ui.screens.currency-settings.models
(ns status-im.ui.screens.currency-settings.models-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.ui.screens.currency-settings.models :as models]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.async
(ns status-im.utils.async-test
(:require [cljs.test :refer-macros [deftest is testing async]]
[cljs.core.async :as async]
[status-im.utils.async :as async-util]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.clocks
(ns status-im.utils.clocks-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.clocks :as clocks]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.contenthash
(ns status-im.utils.contenthash-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.contenthash :as contenthash]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.datetime
(ns status-im.utils.datetime-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.utils.datetime :as d]
[status-im.goog.i18n :as i18n]

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.fx
(ns status-im.utils.fx-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.fx :as fx]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.http
(ns status-im.utils.http-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.http :as http]))
@ -52,4 +52,3 @@
(is (nil? (http/url-host "invalid//status.im/testing"))))
(testing "No scheme"
(is (nil? (http/url-host "status.im/testing"))))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.money
(ns status-im.utils.money-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.money :as money]))
@ -20,4 +20,4 @@
(is (= nil (money/normalize nil)))
(is (= "1" (money/normalize " 1 ")))
(is (= "1.1" (money/normalize "1.1")))
(is (= "1.1" (money/normalize "1,1"))))
(is (= "1.1" (money/normalize "1,1"))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.prices
(ns status-im.utils.prices-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.utils.prices :as prices]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.random
(ns status-im.utils.random-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.utils.random :as random]))
@ -62,7 +62,7 @@
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :f))
(is (= (random/seeded-rand-nth gen coll) :c)))
;try again with the same seed but gen reset
;try again with the same seed but gen reset
(let [seed "6ec565f4fec866a54761524f603cf037e20c2bfa"
gen (random/rand-gen seed)
coll [:a :b :c :d :e :f :g]]
@ -71,7 +71,7 @@
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :f))
(is (= (random/seeded-rand-nth gen coll) :c)))
;try again with a different seed
;try again with a different seed
(let [seed "57348975ff9199ca636207a396b915d6b6a675b4"
gen (random/rand-gen seed)
coll [:a :b :c :d :e :f :g]]
@ -80,7 +80,7 @@
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :a)))
;and re-set
;and re-set
(let [seed "57348975ff9199ca636207a396b915d6b6a675b4"
gen (random/rand-gen seed)
coll [:a :b :c :d :e :f :g]]
@ -88,4 +88,4 @@
(is (= (random/seeded-rand-nth gen coll) :c))
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :e))
(is (= (random/seeded-rand-nth gen coll) :a))))
(is (= (random/seeded-rand-nth gen coll) :a))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.security
(ns status-im.utils.security-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.security :as security]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.signing-phrase.core
(ns status-im.utils.signing-phrase.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.signing-phrase.core :refer [generate]]
[clojure.string :as string]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.transducers
(ns status-im.utils.transducers-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.transducers :as transducers]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.universal-links.core
(ns status-im.utils.universal-links.core-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.utils
(ns status-im.utils.utils-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.utils.core :as u]
[status-im.utils.utils :as uu]))
@ -54,4 +54,4 @@
(is (= "1" (uu/format-decimals 1 5)))
(is (= "1.1" (uu/format-decimals 1.1 5)))
(is (= "1.111111" (uu/format-decimals 1.111111 7)))
(is (= "1.1" (uu/format-decimals 1.111 1))))
(is (= "1.1" (uu/format-decimals 1.111 1))))

View File

@ -1,4 +1,4 @@
(ns status-im.test.utils.varint
(ns status-im.utils.varint-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.utils.varint :as varint]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.ui.screens.wallet.db
(ns status-im.wallet.db-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.wallet.db :as wallet.db]
[status-im.utils.money :as money]

View File

@ -1,4 +1,4 @@
(ns status-im.test.wallet.subs
(ns status-im.wallet.subs-test
(:require [cljs.test :refer-macros [deftest is]]
[status-im.utils.money :as money]
[status-im.subs :as s]))

View File

@ -1,4 +1,4 @@
(ns status-im.test.wallet.transactions
(ns status-im.wallet.transactions-test
(:require [cljs.test :refer-macros [deftest is]]
[goog.Uri :as goog-uri]
[status-im.ethereum.transactions.core :as transactions]

View File

@ -1,8 +0,0 @@
(ns status-im.test.chat.views.photos
(:require [cljs.test :refer [deftest testing is]]
[status-im.utils.image :as utils.image]))
(deftest photos-test
(testing "a normal string"
(let [actual (utils.image/source "some-string")]
(is (= {:uri "some-string"} actual)))))