mirror of
https://github.com/penpot/penpot.git
synced 2025-04-12 06:51:23 -05:00
Fix tests.
This commit is contained in:
parent
ac3d44601a
commit
75905627b6
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
(ns uxbox.state.shapes-tests
|
||||
(:require [cljs.test :as t :include-macros true]
|
||||
[cljs.pprint :refer (pprint)]
|
||||
[uuid.core :as uuid]
|
||||
[uxbox.state.shapes :as ssh]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -24,13 +25,12 @@
|
|||
(assoc-in [:pages-by-id 1 :shapes] [1 2])
|
||||
(assoc-in [:shapes-by-id 2] {:id 2 :page 1}))]
|
||||
|
||||
(with-redefs [cljs.core/random-uuid (constantly 2)]
|
||||
(with-redefs [uuid.core/random (constantly 2)]
|
||||
(let [result (ssh/duplicate-shapes initial [1])]
|
||||
;; (pprint expected)
|
||||
;; (pprint result)
|
||||
(t/is (= result expected))))))
|
||||
|
||||
|
||||
;; duplicate shape: duplicate inside group
|
||||
(t/deftest duplicate-shapes-test2
|
||||
(let [initial {:pages-by-id {1 {:id 1 :shapes [1]}}
|
||||
|
@ -44,7 +44,7 @@
|
|||
(assoc-in [:shapes-by-id 1 :items] [2 3 4 5])
|
||||
(assoc-in [:shapes-by-id 4] {:id 4 :page 1 :group 1})
|
||||
(assoc-in [:shapes-by-id 5] {:id 5 :page 1 :group 1}))]
|
||||
(with-redefs [cljs.core/random-uuid (constantly-inc 4)]
|
||||
(with-redefs [uuid.core/random (constantly-inc 4)]
|
||||
(let [result (ssh/duplicate-shapes initial [2 3])]
|
||||
;; (pprint expected)
|
||||
;; (pprint result)
|
||||
|
@ -65,7 +65,7 @@
|
|||
(assoc-in [:pages-by-id 1 :shapes] [1 4 5 6])
|
||||
(assoc-in [:shapes-by-id 5] {:id 5 :page 1})
|
||||
(assoc-in [:shapes-by-id 6] {:id 6 :page 1}))]
|
||||
(with-redefs [cljs.core/random-uuid (constantly-inc 5)]
|
||||
(with-redefs [uuid.core/random (constantly-inc 5)]
|
||||
(let [result (ssh/duplicate-shapes initial [3 4])]
|
||||
;; (pprint expected)
|
||||
;; (pprint result)
|
||||
|
@ -86,7 +86,7 @@
|
|||
:type :group
|
||||
:items [4]})
|
||||
(assoc-in [:shapes-by-id 4] {:id 4 :page 1 :group 3}))]
|
||||
(with-redefs [cljs.core/random-uuid (constantly-inc 3)]
|
||||
(with-redefs [uuid.core/random (constantly-inc 3)]
|
||||
(let [result (ssh/duplicate-shapes initial [1])]
|
||||
;; (pprint expected)
|
||||
;; (pprint result)
|
||||
|
|
Loading…
Add table
Reference in a new issue