mirror of
https://github.com/penpot/penpot.git
synced 2026-10-05 10:16:16 +00:00
✨ Enable stroke-per-side flag (#11942)
* ✨ Enable stroke-per-side flag * 🐛 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
This commit is contained in:
parent
77c4072b43
commit
8f1100d0f5
@ -228,10 +228,12 @@
|
|||||||
:enable-available-viewer-wasm
|
:enable-available-viewer-wasm
|
||||||
:enable-background-blur
|
:enable-background-blur
|
||||||
:enable-stroke-path
|
:enable-stroke-path
|
||||||
|
:enable-stroke-per-side
|
||||||
:enable-token-combobox
|
:enable-token-combobox
|
||||||
:enable-custom-shortcuts
|
:enable-custom-shortcuts
|
||||||
:enable-token-lib-sync
|
:enable-token-lib-sync
|
||||||
:enable-link-unfurl])
|
:enable-link-unfurl])
|
||||||
|
|
||||||
(defn parse
|
(defn parse
|
||||||
[& flags]
|
[& flags]
|
||||||
(loop [flags (apply concat flags)
|
(loop [flags (apply concat flags)
|
||||||
|
|||||||
@ -59,7 +59,10 @@ test.describe("Tokens: stroke per side", () => {
|
|||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
const workspace = new WasmWorkspacePage(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.setupEmptyFile();
|
||||||
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
|
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
|
||||||
await workspace.goToWorkspace();
|
await workspace.goToWorkspace();
|
||||||
@ -452,7 +455,10 @@ test.describe("Tokens: stroke per side", () => {
|
|||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
const workspace = new WasmWorkspacePage(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.setupEmptyFile();
|
||||||
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
|
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
|
||||||
await workspace.goToWorkspace();
|
await workspace.goToWorkspace();
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
(def ^:private all-label (i18n/tr "labels.all"))
|
(def ^:private all-label (i18n/tr "labels.all"))
|
||||||
|
|
||||||
(def ^:private per-side-flags (conj cf/flags :stroke-per-side))
|
(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 []
|
(defn setup-file []
|
||||||
(-> (tht/sample-file-with-tokens
|
(-> (tht/sample-file-with-tokens
|
||||||
@ -164,7 +165,7 @@
|
|||||||
:separator
|
:separator
|
||||||
{:title "Border Radius", :submenu :border-radius}
|
{:title "Border Radius", :submenu :border-radius}
|
||||||
:separator
|
:separator
|
||||||
{:title "Stroke Width"}
|
{:title "Stroke Width", :submenu :stroke-width}
|
||||||
:separator
|
:separator
|
||||||
{:title "X"}
|
{:title "X"}
|
||||||
{:title "Y"}]))))
|
{:title "Y"}]))))
|
||||||
@ -177,7 +178,7 @@
|
|||||||
:separator
|
:separator
|
||||||
{:title "Border Radius", :submenu :border-radius}
|
{:title "Border Radius", :submenu :border-radius}
|
||||||
:separator
|
:separator
|
||||||
{:title "Stroke Width"}
|
{:title "Stroke Width", :submenu :stroke-width}
|
||||||
:separator
|
:separator
|
||||||
{:title "X"}
|
{:title "X"}
|
||||||
{:title "Y"}]))))
|
{:title "Y"}]))))
|
||||||
@ -208,16 +209,17 @@
|
|||||||
(t/is (= action-titles ["Rotation"])))))
|
(t/is (= action-titles ["Rotation"])))))
|
||||||
|
|
||||||
(t/deftest stroke-width-items
|
(t/deftest stroke-width-items
|
||||||
(t/testing "shows a single global item when per-side is disabled"
|
(with-redefs [cf/flags no-per-side-flags]
|
||||||
(doseq [shape [:rect1 :frame1 :text1]]
|
(t/testing "shows a single global item when per-side is disabled"
|
||||||
(let [actions (token-menu-actions [shape] "token-stroke-width")
|
(doseq [shape [:rect1 :frame1 :text1]]
|
||||||
action-titles (mapv :title actions)]
|
(let [actions (token-menu-actions [shape] "token-stroke-width")
|
||||||
(t/is (= action-titles ["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"
|
(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")
|
(let [actions (token-menu-actions [:rect1 :text1] "token-stroke-width")
|
||||||
action-titles (mapv :title actions)]
|
action-titles (mapv :title actions)]
|
||||||
(t/is (= action-titles ["Stroke Width"])))))
|
(t/is (= action-titles ["Stroke Width"]))))))
|
||||||
|
|
||||||
(t/deftest stroke-width-items-per-side
|
(t/deftest stroke-width-items-per-side
|
||||||
(with-redefs [cf/flags per-side-flags]
|
(with-redefs [cf/flags per-side-flags]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user