From 8f1100d0f534d32a17d307f4dd88086ac8967dcd Mon Sep 17 00:00:00 2001 From: Luis de Dios Date: Mon, 28 Sep 2026 14:39:18 +0200 Subject: [PATCH] :sparkles: Enable stroke-per-side flag (#11942) * :sparkles: Enable stroke-per-side flag * :bug: Fix stroke per side tests for the enabled flag The default flags now include :enable-stroke-per-side, so frontend tests and Playwright specs that assumed the flag was off need to turn it off explicitly. Update the token context menu test expectations: rects and boards now expose the stroke-width submenu, and force the flag off in the "per-side is disabled" cases. Pass disable-stroke-per-side in the two Playwright specs that check the flag-off behavior, since app.config always merges the default flags. AI-assisted-by: deepseek-v4.1-flash --- common/src/app/common/flags.cljc | 2 ++ .../ui/specs/tokens/stroke-per-side.spec.js | 10 ++++++-- .../tokens/context_menu_test.cljs | 24 ++++++++++--------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index 582ecec34a..60353f730f 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -228,10 +228,12 @@ :enable-available-viewer-wasm :enable-background-blur :enable-stroke-path + :enable-stroke-per-side :enable-token-combobox :enable-custom-shortcuts :enable-token-lib-sync :enable-link-unfurl]) + (defn parse [& flags] (loop [flags (apply concat flags) diff --git a/frontend/playwright/ui/specs/tokens/stroke-per-side.spec.js b/frontend/playwright/ui/specs/tokens/stroke-per-side.spec.js index 73bd31655b..61952665bc 100644 --- a/frontend/playwright/ui/specs/tokens/stroke-per-side.spec.js +++ b/frontend/playwright/ui/specs/tokens/stroke-per-side.spec.js @@ -59,7 +59,10 @@ test.describe("Tokens: stroke per side", () => { page, }) => { const workspace = new WasmWorkspacePage(page); - await workspace.mockConfigFlags(["enable-feature-token-input"]); + await workspace.mockConfigFlags([ + "enable-feature-token-input", + "disable-stroke-per-side", + ]); await workspace.setupEmptyFile(); await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json"); await workspace.goToWorkspace(); @@ -452,7 +455,10 @@ test.describe("Tokens: stroke per side", () => { page, }) => { const workspace = new WasmWorkspacePage(page); - await workspace.mockConfigFlags(["enable-feature-token-input"]); + await workspace.mockConfigFlags([ + "enable-feature-token-input", + "disable-stroke-per-side", + ]); await workspace.setupEmptyFile(); await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json"); await workspace.goToWorkspace(); diff --git a/frontend/test/frontend_tests/tokens/context_menu_test.cljs b/frontend/test/frontend_tests/tokens/context_menu_test.cljs index e50cf10915..2c39471c24 100644 --- a/frontend/test/frontend_tests/tokens/context_menu_test.cljs +++ b/frontend/test/frontend_tests/tokens/context_menu_test.cljs @@ -16,6 +16,7 @@ (def ^:private all-label (i18n/tr "labels.all")) (def ^:private per-side-flags (conj cf/flags :stroke-per-side)) +(def ^:private no-per-side-flags (disj cf/flags :stroke-per-side)) (defn setup-file [] (-> (tht/sample-file-with-tokens @@ -164,7 +165,7 @@ :separator {:title "Border Radius", :submenu :border-radius} :separator - {:title "Stroke Width"} + {:title "Stroke Width", :submenu :stroke-width} :separator {:title "X"} {:title "Y"}])))) @@ -177,7 +178,7 @@ :separator {:title "Border Radius", :submenu :border-radius} :separator - {:title "Stroke Width"} + {:title "Stroke Width", :submenu :stroke-width} :separator {:title "X"} {:title "Y"}])))) @@ -208,16 +209,17 @@ (t/is (= action-titles ["Rotation"]))))) (t/deftest stroke-width-items - (t/testing "shows a single global item when per-side is disabled" - (doseq [shape [:rect1 :frame1 :text1]] - (let [actions (token-menu-actions [shape] "token-stroke-width") - action-titles (mapv :title actions)] - (t/is (= action-titles ["Stroke Width"]))))) + (with-redefs [cf/flags no-per-side-flags] + (t/testing "shows a single global item when per-side is disabled" + (doseq [shape [:rect1 :frame1 :text1]] + (let [actions (token-menu-actions [shape] "token-stroke-width") + action-titles (mapv :title actions)] + (t/is (= action-titles ["Stroke Width"]))))) - (t/testing "shows a single global item for mixed selections when per-side is disabled" - (let [actions (token-menu-actions [:rect1 :text1] "token-stroke-width") - action-titles (mapv :title actions)] - (t/is (= action-titles ["Stroke Width"]))))) + (t/testing "shows a single global item for mixed selections when per-side is disabled" + (let [actions (token-menu-actions [:rect1 :text1] "token-stroke-width") + action-titles (mapv :title actions)] + (t/is (= action-titles ["Stroke Width"])))))) (t/deftest stroke-width-items-per-side (with-redefs [cf/flags per-side-flags]