mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 09:42:01 +00:00
* 🐛 Fix compile warnings in the frontend test tree The frontend test build printed 25 analyzer warnings, all of them in test namespaces: 7 :fn-arity and 18 :infer-warning. The arity ones were latent bugs. Both builds use the :esm target, where a call that crosses a namespace boundary becomes a plain JS call, so CLJS arity dispatch never runs and the missing argument arrives as undefined instead of throwing: the warning was the only signal. One `wait-for` call had no message, and five `interaction-proxy` calls still passed five arguments after the six-argument signature landed in #11621. The rest were JS property reads whose target type could not be inferred (proxies, atoms, awaited promises). A `^js` hint on the target fixes them, the convention already used under src/. Inside `set!` a form-level hint does not reach the target, so the two per-side stroke widths bind the stroke first. Test behavior is unchanged: the same 27 tests in shape-bugfixes-test keep their 63 assertions, and the full frontend suite passes (1901 tests, 7686 assertions). The memories record why `:fn-arity` cannot be ignored in this build and how to force a clean recompile before checking for warnings. AI-assisted-by: deepseek-v4.1-flash * ♻️ Split the tokens plugin tests into one test per case `tokens_test.cljs` drove five tests from `doseq` tables, one of them a nested loop over three catalogs and seventeen mutations. A failure only named the case through its `t/testing` label, and the nested one shared a single store across all fifty-one combinations. Each row is now a test of its own: twelve stroke property edits, four `tokensSource` rejections, seventeen catalog mutations (each asserting the local, source and other connected catalog), five activation changes and three token application paths, taking the namespace from 67 to 104 tests. Fixtures (`stroke-tokens-fixture`, `external-tokens-fixture`, ...) keep the arrangement in one place, and every test builds a fresh store. Two helpers return JS objects with `^js` on their names, so the test bodies stay free of interop hints. Assertions drop from 430 to 345 because the cross product no longer repeats `isEditableTokens` and `tokens-unchanged?` once per catalog and mutation; every write is still asserted against the three catalogs. `mem:testing` now says tables are for short identical bodies only; `frontend/testing` records the `defn ^js` return-tag trick. Verified: namespace 104 tests / 345 assertions, full frontend suite 1938 tests / 7601 assertions, 0 failures; test build 0 warnings; cljfmt and clj-kondo clean. AI-assisted-by: deepseek-v4.1-flash * 📎 Apply suggestion from @elenatorro Co-authored-by: Elena Torró <elenatorro@gmail.com> Signed-off-by: Andrey Antukh <niwi@niwi.nz> --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz> Co-authored-by: Elena Torró <elenatorro@gmail.com>