From aecb8a146409335d2ae5c040ba2d3afe80b7b22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 15 Feb 2022 16:17:32 +0100 Subject: [PATCH] :bug: Fix some broken tests --- common/test/app/common/geom_test.cljc | 20 ++++++++++++++----- .../app/common/pages_migrations_test.cljc | 4 ++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/common/test/app/common/geom_test.cljc b/common/test/app/common/geom_test.cljc index 8a4b7af2f..0828a7616 100644 --- a/common/test/app/common/geom_test.cljc +++ b/common/test/app/common/geom_test.cljc @@ -71,21 +71,31 @@ (t/deftest matrix-constructors-test (let [m (gmt/matrix)] - (t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,0.0,0.0)"))) + (t/is (= 1.0 (.-a m))) + (t/is (= 0.0 (.-b m))) + (t/is (= 0.0 (.-c m))) + (t/is (= 1.0 (.-d m))) + (t/is (= 0.0 (.-e m))) + (t/is (= 0.0 (.-f m)))) (let [m (gmt/matrix 1 1 1 2 2 2)] - (t/is (= (str m) "matrix(1.0,1.0,1.0,2.0,2.0,2.0)")))) + (t/is (= 1.0 (.-a m))) + (t/is (= 1.0 (.-b m))) + (t/is (= 1.0 (.-c m))) + (t/is (= 2.0 (.-d m))) + (t/is (= 2.0 (.-e m))) + (t/is (= 2.0 (.-f m))))) (t/deftest matrix-translate-test (let [m (-> (gmt/matrix) (gmt/translate (gpt/point 2 10)))] - (t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,2.0,10.0)")))) + (t/is (= m (gmt/matrix 1 0 0 1 2 10))))) (t/deftest matrix-scale-test (let [m (-> (gmt/matrix) (gmt/scale (gpt/point 2)))] - (t/is (= (str m) "matrix(2.0,0.0,0.0,2.0,0.0,0.0)")))) + (t/is (= m (gmt/matrix 2 0 0 2 0 0))))) (t/deftest matrix-rotate-test (let [m (-> (gmt/matrix) (gmt/rotate 10))] - (t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0.0,0.0)")))) + (t/is (= m (gmt/matrix 0.984807753012208 0.17364817766693033 -0.17364817766693033 0.984807753012208 0 0))))) diff --git a/common/test/app/common/pages_migrations_test.cljc b/common/test/app/common/pages_migrations_test.cljc index 12950ca0a..89cbbcc9b 100644 --- a/common/test/app/common/pages_migrations_test.cljc +++ b/common/test/app/common/pages_migrations_test.cljc @@ -38,7 +38,7 @@ :components {} :version 7} - res (cpm/migrate-data data)] + res (cpm/migrate-data data nil 8)] ;; (pprint data) ;; (pprint res) @@ -81,7 +81,7 @@ (let [id (uuid/custom 1 2)] (into [] (remove #(= id %)) shapes))))) - res (cpm/migrate-data data)] + res (cpm/migrate-data data nil 8)] ;; (pprint res) ;; (pprint expect)