🐛 Fix flaky plugin creation parent test (#12858)

The svg-with-images case asserted that the stubbed rp/cmd! saw only the
URL upload RPC. clear-thumbnail sends :delete-file-object-thumbnails after
a 200 ms timer, so on slow CI runners that call was recorded too and the
assertion failed.

Count only the :create-file-media-object-from-url calls and expect one,
so unrelated RPCs no longer break the test.

AI-assisted-by: claude-opus-5-5
This commit is contained in:
Belén Albeza 2026-11-05 13:26:19 +01:00 committed by GitHub
parent e42bae34cf
commit eae2c5bc95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,7 +86,9 @@
(t/is (not (some #{id} (get-in @store (into path [(thi/id :board) :shapes])))))
(t/is (= 1 (count (get-in @store [:workspace-undo :items])))))
(when (= creation :svg-with-images)
(t/is (= [:create-file-media-object-from-url] (mapv first @uploads))))
;; Other RPCs (e.g. the delayed thumbnail cleanup) may land too.
(t/is (= 1 (count (filter #{:create-file-media-object-from-url}
(map first @uploads))))))
(ptk/emit! store dwu/undo)
(await (async/wait-for #(nil? (get-in @store (conj path id))) "creation undone"))
(t/is (nil? (get-in @store (conj path id))))