diff --git a/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs b/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs index 848015d982..2ffaf2de4a 100644 --- a/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs +++ b/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs @@ -11,6 +11,7 @@ down on purpose, so a step that resolved early would see a half-synced file." (:require + [app.common.math :as mth] [app.common.test-helpers.composable.comp.nodes :as n] [app.common.test-helpers.composable.comp.setups :as setup] [app.common.test-helpers.composable.comp.undo-check :as uc] @@ -30,6 +31,14 @@ (t/use-fixtures :each ftm/fixture) +(t/deftest ^:async rotation-nodes-compose-successive-turns + (let [initial (ftm/start-generated (setup/simple-component-with-labeled-copy)) + first-turn (await (ftm/run-generated-step initial (n/rotate :copy-root 45))) + second-turn (await (ftm/run-generated-step first-turn (n/rotate :copy-root 90))) + shape (ths/get-shape (ftm/current-file) :copy-root)] + (t/is (mth/close? 135 (:rotation shape) 0.01)) + (t/is (empty? (uc/failures second-turn))))) + (def ^:private original "#abcdef") (def ^:private red "#ff0000") diff --git a/frontend/test/frontend_tests/composable_tests/interpreter.cljs b/frontend/test/frontend_tests/composable_tests/interpreter.cljs index 8ad626cb93..62757b048c 100644 --- a/frontend/test/frontend_tests/composable_tests/interpreter.cljs +++ b/frontend/test/frontend_tests/composable_tests/interpreter.cljs @@ -169,9 +169,9 @@ :original-content (:content shape))]) (instance? n/Rotate op) - ;; the sidebar rotation, which decides what it touches in copies (check-delta) + ;; A node turns by its angle, including after an earlier rotation. (let [{:keys [target angle]} op] - [(dwt/increase-rotation [(tm/target-shape-id situation target)] angle)]) + [(dwt/increase-rotation [(tm/target-shape-id situation target)] angle {:delta? true})]) (instance? n/MoveShape op) ;; the sidebar position, in page coordinates