From 6754c883ab05a5210b5f5b8c150d86346a06858a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 28 Oct 2026 16:09:55 +0100 Subject: [PATCH] :bug: 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 --- .../test/backend_tests/rpc_binfile_test.clj | 16 +++++++------- common/src/app/common/types/component.cljc | 3 ++- .../types/absorb_assets_test.cljc | 2 +- .../logic/comp_watcher_test.cljs | 22 +++++++++---------- frontend/test/frontend_tests/runner.cljs | 2 +- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/backend/test/backend_tests/rpc_binfile_test.clj b/backend/test/backend_tests/rpc_binfile_test.clj index e684d5b7e0..f15a261040 100644 --- a/backend/test/backend_tests/rpc_binfile_test.clj +++ b/backend/test/backend_tests/rpc_binfile_test.clj @@ -175,14 +175,14 @@ (defn- import-file [profile path] - (let [out (th/command! {::th/type :import-binfile - ::rpc/profile-id (:id profile) - :project-id (:default-project-id profile) - :name "imported" - :file {:filename "imported.penpot" - :size (fs/size path) - :path path - :mtype "application/zip"}})] + (let [out (th/multipart-command! {::th/type :import-binfile + ::rpc/profile-id (:id profile) + :project-id (:default-project-id profile) + :name "imported" + :file {:filename "imported.penpot" + :size (fs/size path) + :path path + :mtype "application/zip"}})] (t/is (nil? (:error out))) (th/consume-sse (:result out)))) 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 f8d3bc8783..a85e926aee 100644 --- a/frontend/test/frontend_tests/logic/comp_watcher_test.cljs +++ b/frontend/test/frontend_tests/logic/comp_watcher_test.cljs @@ -11,12 +11,11 @@ [app.common.test-helpers.files :as cthf] [app.common.test-helpers.ids-map :as cthi] [app.common.test-helpers.shapes :as cths] - [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] @@ -25,7 +24,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 @@ -63,20 +61,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") @@ -96,5 +94,7 @@ (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)))))) diff --git a/frontend/test/frontend_tests/runner.cljs b/frontend/test/frontend_tests/runner.cljs index 23643bf330..fdc005a56c 100644 --- a/frontend/test/frontend_tests/runner.cljs +++ b/frontend/test/frontend_tests/runner.cljs @@ -65,8 +65,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]