♻️ Refactor tests directory structure

This commit is contained in:
Andrey Antukh 2022-11-08 10:40:19 +01:00 committed by Andrés Moya
parent 12e2d3ad96
commit 3ef99c287e
45 changed files with 170 additions and 116 deletions

View file

@ -62,19 +62,19 @@ jobs:
name: common tests name: common tests
command: | command: |
yarn install yarn install
yarn run compile-test yarn test
node target/test.js clojure -X:dev:test :patterns '["common-tests.*-test"]'
clojure -X:dev:test :patterns '["common-tests.test-.*"]'
environment: environment:
PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin
JVM_OPTS: -Xmx4g JVM_OPTS: -Xmx4g
NODE_OPTIONS: --max-old-space-size=4096
- run: - run:
name: backend test name: backend test
working_directory: "./backend" working_directory: "./backend"
command: | command: |
clojure -X:dev:test :patterns '["app-tests.test-.*"]' clojure -X:dev:test :patterns '["backend-tests.*-test"]'
environment: environment:
PENPOT_TEST_DATABASE_URI: "postgresql://localhost/penpot_test" PENPOT_TEST_DATABASE_URI: "postgresql://localhost/penpot_test"
@ -88,11 +88,11 @@ jobs:
working_directory: "./frontend" working_directory: "./frontend"
command: | command: |
yarn install yarn install
clojure -M:dev:shadow-cljs compile test yarn test
node target/tests.js
environment: environment:
PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin
NODE_OPTIONS: --max-old-space-size=4096
- save_cache: - save_cache:
paths: paths:

View file

@ -63,7 +63,7 @@
;; --- Development Stuff ;; --- Development Stuff
(defn- run-tests (defn- run-tests
([] (run-tests #"^backend-tests.test-.*$")) ([] (run-tests #"^backend-tests.*-test$"))
([o] ([o]
(repl/refresh) (repl/refresh)
(cond (cond

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-bounce-handling (ns backend-tests.bounce-handling-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.db :as db] [app.db :as db]
[app.emails :as emails] [app.emails :as emails]
[app.http.awsns :as awsns] [app.http.awsns :as awsns]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-email-sending (ns backend-tests.email-sending-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.db :as db] [app.db :as db]
[app.emails :as emails] [app.emails :as emails]
[clojure.test :as t] [clojure.test :as t]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-helpers (ns backend-tests.helpers
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.flags :as flags] [app.common.flags :as flags]
@ -65,7 +65,7 @@
:name "test" :name "test"
:file-uri "test" :file-uri "test"
:thumbnail-uri "test" :thumbnail-uri "test"
:path (-> "app_tests/test_files/template.penpot" io/resource fs/path)}] :path (-> "backend_tests/test_files/template.penpot" io/resource fs/path)}]
system (-> (merge main/system-config main/worker-config) system (-> (merge main/system-config main/worker-config)
(assoc-in [:app.redis/redis :uri] (:redis-uri config)) (assoc-in [:app.redis/redis :uri] (:redis-uri config))
(assoc-in [:app.db/pool :uri] (:database-uri config)) (assoc-in [:app.db/pool :uri] (:database-uri config))

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-file (ns backend-tests.rpc-file-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.db.sql :as sql] [app.db.sql :as sql]
@ -124,7 +124,7 @@
(t/deftest file-gc-task (t/deftest file-gc-task
(letfn [(create-file-media-object [{:keys [profile-id file-id]}] (letfn [(create-file-media-object [{:keys [profile-id file-id]}]
(let [mfile {:filename "sample.jpg" (let [mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}
params {::th/type :upload-file-media-object params {::th/type :upload-file-media-object

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-font (ns backend-tests.rpc-font-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.http :as http] [app.http :as http]
@ -24,7 +24,7 @@
proj-id (:default-project-id prof) proj-id (:default-project-id prof)
font-id (uuid/custom 10 1) font-id (uuid/custom 10 1)
ttfdata (-> (io/resource "app_tests/test_files/font-1.ttf") ttfdata (-> (io/resource "backend_tests/test_files/font-1.ttf")
io/input-stream io/input-stream
io/read-as-bytes) io/read-as-bytes)
@ -59,7 +59,7 @@
proj-id (:default-project-id prof) proj-id (:default-project-id prof)
font-id (uuid/custom 10 1) font-id (uuid/custom 10 1)
data (-> (io/resource "app_tests/test_files/font-1.woff") data (-> (io/resource "backend_tests/test_files/font-1.woff")
io/input-stream io/input-stream
io/read-as-bytes) io/read-as-bytes)

View file

@ -4,10 +4,10 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-management (ns backend-tests.rpc-management-test
(:require (:require
[backend-tests.test-storage :refer [configure-storage-backend]] [backend-tests.storage-test :refer [configure-storage-backend]]
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.http :as http] [app.http :as http]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-media (ns backend-tests.rpc-media-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.storage :as sto] [app.storage :as sto]
@ -60,7 +60,7 @@
:project-id (:default-project-id prof) :project-id (:default-project-id prof)
:is-shared false}) :is-shared false})
mfile {:filename "sample.jpg" mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}
@ -99,7 +99,7 @@
:project-id (:default-project-id prof) :project-id (:default-project-id prof)
:is-shared false}) :is-shared false})
mfile {:filename "sample.jpg" mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-profile (ns backend-tests.rpc-profile-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.config :as cf] [app.config :as cf]
[app.db :as db] [app.db :as db]
@ -110,7 +110,7 @@
:profile-id (:id profile) :profile-id (:id profile)
:file {:filename "sample.jpg" :file {:filename "sample.jpg"
:size 123123 :size 123123
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg"}} :mtype "image/jpeg"}}
out (th/mutation! data)] out (th/mutation! data)]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-project (ns backend-tests.rpc-project-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.http :as http] [app.http :as http]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-team (ns backend-tests.rpc-team-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[app.http :as http] [app.http :as http]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-rpc-viewer (ns backend-tests.rpc-viewer-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
[clojure.test :as t] [clojure.test :as t]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-storage (ns backend-tests.storage-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.exceptions :as ex] [app.common.exceptions :as ex]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.db :as db] [app.db :as db]
@ -126,7 +126,7 @@
:is-shared false}) :is-shared false})
mfile {:filename "sample.jpg" mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}
@ -196,12 +196,12 @@
:project-id proj-id :project-id proj-id
:is-shared false}) :is-shared false})
ttfdata (-> (io/resource "app_tests/test_files/font-1.ttf") ttfdata (-> (io/resource "backend_tests/test_files/font-1.ttf")
io/input-stream io/input-stream
io/read-as-bytes) io/read-as-bytes)
mfile {:filename "sample.jpg" mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}
@ -267,7 +267,7 @@
:project-id (:default-project-id prof) :project-id (:default-project-id prof)
:is-shared false}) :is-shared false})
mfile {:filename "sample.jpg" mfile {:filename "sample.jpg"
:path (th/tempfile "app_tests/test_files/sample.jpg") :path (th/tempfile "backend_tests/test_files/sample.jpg")
:mtype "image/jpeg" :mtype "image/jpeg"
:size 312043} :size 312043}

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-telemetry-task (ns backend-tests.tasks-telemetry-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.db :as db] [app.db :as db]
[app.emails :as emails] [app.emails :as emails]
[app.util.time :as dt] [app.util.time :as dt]

Binary file not shown.

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-util-objects-map (ns backend-tests.util-objects-map-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.spec :as us] [app.common.spec :as us]
[app.common.transit :as transit] [app.common.transit :as transit]
[app.common.types.shape :as cts] [app.common.types.shape :as cts]

View file

@ -4,9 +4,9 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns backend-tests.test-util-pointer-map (ns backend-tests.util-pointer-map-test
(:require (:require
[backend-tests.test-helpers :as th] [backend-tests.helpers :as th]
[app.common.spec :as us] [app.common.spec :as us]
[app.common.transit :as transit] [app.common.transit :as transit]
[app.common.types.shape :as cts] [app.common.types.shape :as cts]

View file

@ -8,7 +8,7 @@
{:target :node-test {:target :node-test
:output-to "target/test.js" :output-to "target/test.js"
:output-dir "target/test/" :output-dir "target/test/"
:ns-regexp "^common-tests.test-.*$" :ns-regexp "^common-tests.*-test$"
:autorun true :autorun true
:compiler-options :compiler-options

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-data (ns common-tests.data-test
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[clojure.test :as t])) [clojure.test :as t]))

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-geom-shapes (ns common-tests.geom-shapes-test
(:require (:require
[app.common.geom.matrix :as gmt] [app.common.geom.matrix :as gmt]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-geom (ns common-tests.geom-test
(:require (:require
[clojure.test :as t] [clojure.test :as t]
[app.common.math :as mth] [app.common.math :as mth]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-helpers.components (ns common-tests.helpers.components
(:require (:require
[clojure.test :as t] [clojure.test :as t]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-helpers.files (ns common-tests.helpers.files
(:require (:require
[app.common.files.features :as ffeat] [app.common.files.features :as ffeat]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-pages-helpers (ns common-tests.pages-helpers-test
(:require (:require
[clojure.test :as t] [clojure.test :as t]
[clojure.pprint :refer [pprint]] [clojure.pprint :refer [pprint]]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-pages-migrations (ns common-tests.pages-migrations-test
(:require (:require
[clojure.test :as t] [clojure.test :as t]
[clojure.pprint :refer [pprint]] [clojure.pprint :refer [pprint]]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-pages (ns common-tests.pages-test
(:require (:require
[app.common.files.features :as ffeat] [app.common.files.features :as ffeat]
[app.common.pages :as cp] [app.common.pages :as cp]

View file

@ -1,6 +1,6 @@
(ns app.init-test (ns common-tests.setup
(:require (:require
[cljs.test :as t :include-macros true])) [clojure.test :as t]))
(defmethod t/report [:cljs.test/default :end-run-tests] (defmethod t/report [:cljs.test/default :end-run-tests]
[m] [m]

View file

@ -1,10 +0,0 @@
(ns common-tests.test-setup
(:require
[clojure.test :as t]))
#?(:cljs
(defmethod t/report [:cljs.test/default :end-run-tests]
[m]
(if (t/successful? m)
(set! (.-exitCode js/process) 0)
(set! (.-exitCode js/process) 1))))

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-text (ns common-tests.text-test
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.text :as txt] [app.common.text :as txt]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-types-file (ns common-tests.types-file-test
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
@ -21,8 +21,8 @@
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[clojure.pprint :refer [pprint]] [clojure.pprint :refer [pprint]]
[clojure.test :as t] [clojure.test :as t]
[common-tests.test-helpers.components :as thk] [common-tests.helpers.components :as thk]
[common-tests.test-helpers.files :as thf] [common-tests.helpers.files :as thf]
[cuerdas.core :as str])) [cuerdas.core :as str]))
(t/use-fixtures :each thf/reset-idmap!) (t/use-fixtures :each thf/reset-idmap!)

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-types-shape-interactions (ns common-tests.types-shape-interactions-test
(:require (:require
[app.common.exceptions :as ex] [app.common.exceptions :as ex]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-types (ns common-tests.types-test
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[clojure.test :as t] [clojure.test :as t]

View file

@ -4,7 +4,7 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns common-tests.test-uuid (ns common-tests.uuid-test
(:require (:require
[app.common.spec :as us] [app.common.spec :as us]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]

View file

@ -86,7 +86,7 @@
{:target :node-test {:target :node-test
:output-to "target/tests.js" :output-to "target/tests.js"
:output-dir "target/test/" :output-dir "target/test/"
:ns-regexp "^app.*-test$" :ns-regexp "^frontend-tests.*-test$"
:autorun true :autorun true
:compiler-options :compiler-options

View file

@ -1,14 +1,20 @@
(ns app.test-helpers.events ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.helpers.events
(:require (:require
[app.common.uuid :as uuid]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
[app.common.geom.shapes :as gsh] [app.common.geom.shapes :as gsh]
[app.common.pages :as cp] [app.common.pages :as cp]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]
[app.common.uuid :as uuid]
[app.main.data.workspace :as dw] [app.main.data.workspace :as dw]
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]
[beicon.core :as rx] [beicon.core :as rx]
[cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]
[potok.core :as ptk])) [potok.core :as ptk]))
;; ---- Helpers to manage global events ;; ---- Helpers to manage global events

View file

@ -1,12 +1,18 @@
(ns app.test-helpers.libraries ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.helpers.libraries
(:require (:require
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]
[app.common.types.component :as ctk] [app.common.types.component :as ctk]
[app.common.types.container :as ctn] [app.common.types.container :as ctn]
[app.main.data.workspace.state-helpers :as wsh] [app.main.data.workspace.state-helpers :as wsh]
[app.test-helpers.pages :as thp])) [cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.pages :as thp]))
;; ---- Helpers to manage libraries and synchronization ;; ---- Helpers to manage libraries and synchronization

View file

@ -1,20 +1,26 @@
(ns app.test-helpers.pages ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.helpers.pages
(:require (:require
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]
[beicon.core :as rx]
[potok.core :as ptk]
[app.common.uuid :as uuid]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
[app.common.geom.shapes :as gsh] [app.common.geom.shapes :as gsh]
[app.common.pages :as cp] [app.common.pages :as cp]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]
[app.common.types.shape :as cts] [app.common.types.shape :as cts]
[app.common.uuid :as uuid]
[app.main.data.workspace :as dw] [app.main.data.workspace :as dw]
[app.main.data.workspace.groups :as dwg] [app.main.data.workspace.groups :as dwg]
[app.main.data.workspace.layout :as layout] [app.main.data.workspace.layout :as layout]
[app.main.data.workspace.libraries-helpers :as dwlh] [app.main.data.workspace.libraries-helpers :as dwlh]
[app.main.data.workspace.state-helpers :as wsh])) [app.main.data.workspace.state-helpers :as wsh]
[beicon.core :as rx]
[cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]
[potok.core :as ptk]))
;; ---- Helpers to manage pages and objects ;; ---- Helpers to manage pages and objects

View file

@ -1,17 +1,23 @@
(ns app.shapes-test ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.helpers-shapes-test
(:require (:require
[app.common.colors :as clr] [app.common.colors :as clr]
[app.common.data :as d] [app.common.data :as d]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]
[app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries :as dwl]
[app.test-helpers.events :as the]
[app.test-helpers.libraries :as thl]
[app.test-helpers.pages :as thp]
[beicon.core :as rx] [beicon.core :as rx]
[cljs.pprint :refer [pprint]] [cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true] [cljs.test :as t :include-macros true]
[clojure.stacktrace :as stk] [clojure.stacktrace :as stk]
[frontend-tests.helpers.events :as the]
[frontend-tests.helpers.libraries :as thl]
[frontend-tests.helpers.pages :as thp]
[linked.core :as lks] [linked.core :as lks]
[potok.core :as ptk])) [potok.core :as ptk]))

View file

@ -0,0 +1,22 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.setup
(:require
[cljs.test :as t :include-macros true]))
#_(enable-console-print!)
(defmethod t/report [:cljs.test/default :end-run-tests]
[m]
(if (t/successful? m)
(set! (.-exitCode js/process) 0)
(set! (.-exitCode js/process) 1)))
#_(set! *main-cli-fn*
#(t/run-tests 'frontend-tests.test-snap-data
'frontend-tests.test-simple-math
'frontend-tests.test-range-tree))

View file

@ -1,4 +1,10 @@
(ns app.components-sync-test ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.state-components-sync-test
(:require (:require
[app.common.colors :as clr] [app.common.colors :as clr]
[app.common.data :as d] [app.common.data :as d]
@ -7,16 +13,16 @@
[app.common.types.container :as ctn] [app.common.types.container :as ctn]
[app.main.data.workspace :as dw] [app.main.data.workspace :as dw]
[app.main.data.workspace.changes :as dch] [app.main.data.workspace.changes :as dch]
[app.main.data.workspace.shapes :as dwsh]
[app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries :as dwl]
[app.main.data.workspace.libraries-helpers :as dwlh] [app.main.data.workspace.libraries-helpers :as dwlh]
[app.main.data.workspace.shapes :as dwsh]
[app.main.data.workspace.state-helpers :as wsh] [app.main.data.workspace.state-helpers :as wsh]
[app.test-helpers.events :as the]
[app.test-helpers.libraries :as thl]
[app.test-helpers.pages :as thp]
[beicon.core :as rx] [beicon.core :as rx]
[cljs.pprint :refer [pprint]] [cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true] [cljs.test :as t :include-macros true]
[frontend-tests.helpers.events :as the]
[frontend-tests.helpers.libraries :as thl]
[frontend-tests.helpers.pages :as thp]
[linked.core :as lks] [linked.core :as lks]
[potok.core :as ptk])) [potok.core :as ptk]))

View file

@ -1,4 +1,4 @@
(ns app.components-basic-test (ns frontend-tests.state-components-test
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
@ -10,13 +10,13 @@
[app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries :as dwl]
[app.main.data.workspace.libraries-helpers :as dwlh] [app.main.data.workspace.libraries-helpers :as dwlh]
[app.main.data.workspace.state-helpers :as wsh] [app.main.data.workspace.state-helpers :as wsh]
[app.test-helpers.events :as the]
[app.test-helpers.libraries :as thl]
[app.test-helpers.pages :as thp]
[beicon.core :as rx] [beicon.core :as rx]
[cljs.pprint :refer [pprint]] [cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true] [cljs.test :as t :include-macros true]
[clojure.stacktrace :as stk] [clojure.stacktrace :as stk]
[frontend-tests.helpers.events :as the]
[frontend-tests.helpers.libraries :as thl]
[frontend-tests.helpers.pages :as thp]
[linked.core :as lks] [linked.core :as lks]
[potok.core :as ptk])) [potok.core :as ptk]))

View file

@ -1,9 +1,15 @@
(ns app.util.range-tree-test ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.util-range-tree-test
(:require (:require
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
[app.util.range-tree :as rt])) [app.util.range-tree :as rt]
[cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]))
(defn check-max-height [tree num-nodes]) (defn check-max-height [tree num-nodes])
(defn check-sorted [tree]) (defn check-sorted [tree])

View file

@ -1,4 +1,10 @@
(ns app.util.simple-math-test ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.util-simple-math-test
(:require (:require
[cljs.test :as t :include-macros true] [cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]] [cljs.pprint :refer [pprint]]

View file

@ -4,13 +4,13 @@
;; ;;
;; Copyright (c) KALEIDOS INC ;; Copyright (c) KALEIDOS INC
(ns app.util.snap-data-test (ns frontend-tests.util-snap-data-test
(:require (:require
[app.common.uuid :as uuid]
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]
[app.common.file-builder :as fb] [app.common.file-builder :as fb]
[app.util.snap-data :as sd])) [app.common.uuid :as uuid]
[app.util.snap-data :as sd]
[cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]))
(t/deftest test-create-index (t/deftest test-create-index
(t/testing "Create empty data" (t/testing "Create empty data"