🐛 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
This commit is contained in:
alonso.torres 2026-10-28 16:09:55 +01:00
parent 09fb1abf09
commit 6754c883ab
5 changed files with 23 additions and 22 deletions

View File

@ -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))))

View File

@ -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

View File

@ -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]

View File

@ -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))))))

View File

@ -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]