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]