From 4719ababe844da9e048f0beb947588858e68c5c1 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 28 Oct 2026 16:09:55 +0100 Subject: [PATCH] :paperclip: Restore merged imports and multipart test setup Keep the string helper required by the variant rename predicate after removing the old swap-slot helpers. Sort the merged test imports. Send import-audit fixtures through the existing multipart RPC helper so they exercise auditing through the required upload path. Start the edit watcher in the isolated component test so it forwards recorded transitions. AI-assisted-by: GPT-6 --- common/src/app/common/types/component.cljc | 3 ++- .../types/absorb_assets_test.cljc | 2 +- .../logic/comp_watcher_test.cljs | 21 ++++++++++--------- frontend/test/frontend_tests/runner.cljs | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/common/src/app/common/types/component.cljc b/common/src/app/common/types/component.cljc index 05b9f0599b..f894c4bcde 100644 --- a/common/src/app/common/types/component.cljc +++ b/common/src/app/common/types/component.cljc @@ -10,7 +10,8 @@ [app.common.time :as-alias ct] [app.common.types.page :as ctp] [app.common.types.plugins :as ctpg] - [app.common.types.variant :as ctv])) + [app.common.types.variant :as ctv] + [cuerdas.core :as str])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SCHEMA diff --git a/common/test/common_tests/types/absorb_assets_test.cljc b/common/test/common_tests/types/absorb_assets_test.cljc index f8b5bb560b..4b6f0a258b 100644 --- a/common/test/common_tests/types/absorb_assets_test.cljc +++ b/common/test/common_tests/types/absorb_assets_test.cljc @@ -9,8 +9,8 @@ [app.common.data :as d] [app.common.files.changes-builder :as pcb] [app.common.files.validate :as cfv] - [app.common.logic.shapes :as cls] [app.common.logic.libraries :as cll] + [app.common.logic.shapes :as cls] [app.common.test-helpers.components :as thc] [app.common.test-helpers.compositions :as tho] [app.common.test-helpers.files :as thf] diff --git a/frontend/test/frontend_tests/logic/comp_watcher_test.cljs b/frontend/test/frontend_tests/logic/comp_watcher_test.cljs index b9767480ba..bb77fecc26 100644 --- a/frontend/test/frontend_tests/logic/comp_watcher_test.cljs +++ b/frontend/test/frontend_tests/logic/comp_watcher_test.cljs @@ -13,11 +13,11 @@ [app.common.test-helpers.shapes :as cths] [app.main.data.changes :as dch] [app.main.data.helpers :as dsh] + [app.main.data.workspace :as dw] [app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.pages :as dwpg] [app.main.data.workspace.shapes :as dwsh] [app.main.data.workspace.thumbnails-wasm :as dwt.wasm] - [app.main.refs :as refs] [app.main.store :as st] [beicon.v2.core :as rx] [cljs.test :as t :include-macros true] @@ -26,7 +26,6 @@ [frontend-tests.helpers.pages :as thp] [frontend-tests.helpers.state :as ths] [frontend-tests.helpers.wasm :as thw] - [okulary.core :as l] [potok.v2.core :as ptk])) (t/use-fixtures :each @@ -64,20 +63,20 @@ (:shapes (cths/get-shape file :copy-root)))) (t/deftest ^:async child-moved-out-of-main-leaves-copy-when-another-edit-follows - ;; The move and the fill change commit in the same tick, so the watcher - ;; inspects both in one batch. The move must be checked against the file - ;; data right before it, where the rect still sits in the main. + ;; The move and fill edit commit in the same tick. The move must use + ;; its prior data, where the rect still sits in the main. The edit + ;; watcher records undo before forwarding each transition to sync. (let [file (setup-file) store (ths/setup-store file)] (await (mock/with-mocks* - {;; The watcher reads the file data through this lens. - refs/workspace-data (l/derived dsh/lookup-file-data store) - ;; Thumbnail renders read the global store. + {;; Thumbnail renders read the global store. st/state store dwt.wasm/render-thumbnail noop-render-thumbnail} - (ptk/emit! store (dwl/watch-component-changes)) + (ptk/emit! store + (dw/initialize-edit-watchers) + (dwl/watch-component-changes)) (t/is (= 1 (count (copy-children store))) "the copy starts with its rect") @@ -97,7 +96,9 @@ (t/is (empty? (copy-children store)) "the copy lost its rect")) - (ptk/emit! store (dwpg/finalize-page (:id file) (cthf/current-page-id file))) + (ptk/emit! store + (dw/finalize-edit-watchers) + (dwpg/finalize-page (:id file) (cthf/current-page-id file))) (await (async/settle)))))) ;; Scenario: a rollback reverts the opacity of the main's child. A rollback diff --git a/frontend/test/frontend_tests/runner.cljs b/frontend/test/frontend_tests/runner.cljs index 180eb5ca92..232af117da 100644 --- a/frontend/test/frontend_tests/runner.cljs +++ b/frontend/test/frontend_tests/runner.cljs @@ -77,8 +77,8 @@ [frontend-tests.fonts-test] [frontend-tests.helpers-shapes-test] [frontend-tests.logic.bool-move-test] - [frontend-tests.logic.comp-watcher-test] [frontend-tests.logic.comp-move-swapped-copies-test] + [frontend-tests.logic.comp-watcher-test] [frontend-tests.logic.components-and-tokens] [frontend-tests.logic.copy-paste-typography-test] [frontend-tests.logic.copying-and-duplicating-test]