diff --git a/frontend/playwright/ui/specs/tokens/crud.spec.js b/frontend/playwright/ui/specs/tokens/crud.spec.js index 60bbf862c6..4c07954fa5 100644 --- a/frontend/playwright/ui/specs/tokens/crud.spec.js +++ b/frontend/playwright/ui/specs/tokens/crud.spec.js @@ -1818,8 +1818,6 @@ test("User disables the current set but token still have resolved values shown i }); test.describe("User can't create groups that clash with token names", () => { - const unknownError = "Unknown error"; - const changeSetInput = async (sidebar, setName, finalKey = "Enter") => { const setInput = sidebar.locator("input:focus"); await expect(setInput).toBeVisible(); @@ -1860,7 +1858,7 @@ test.describe("User can't create groups that clash with token names", () => { // Check that the value has an error const errorNode = - tokensUpdateCreateModal.getByText(unknownError); + tokensUpdateCreateModal.getByText(`Group name of ${name} conflicts with a token of the same name in another active set.`); await expect(errorNode).toBeVisible(); @@ -2037,7 +2035,7 @@ test("User can't create Text Decoration token with group name that clashes with await createSet(tokenThemesSetsSidebar, "Second set"); - await createBadToken(page, "Text Decoration", "td1.bad", "Value", "underline"); + await createBadToken(page, "Text Decoration", "dec1.bad", "Value", "strike-through"); }); test("User can't create Typography token with group name that clashes with existing token", async ({ page }) => { @@ -2103,7 +2101,7 @@ test("User can't create Text Decoration token with group name that clashes with name: "Save", }); - const errorNode = tokensUpdateCreateModal.getByText(unknownError); + const errorNode = tokensUpdateCreateModal.getByText("Group name of typ1.bad conflicts with a token of the same name in another active set."); await expect(errorNode).toHaveCount(6); await expect(submitButton).toBeDisabled(); }); @@ -2161,8 +2159,8 @@ test("User can't create Text Decoration token with group name that clashes with name: "Save", }); - const errorNode = tokensUpdateCreateModal.getByText(unknownError); - await expect(errorNode).toHaveCount(4); + const errorNode = tokensUpdateCreateModal.getByText("Group name of sha1.bad conflicts with a token of the same name in another active set."); + await expect(errorNode).toHaveCount(5); await expect(submitButton).toBeDisabled(); }); }); diff --git a/frontend/src/app/main/data/style_dictionary.cljs b/frontend/src/app/main/data/style_dictionary.cljs index 4e0a1fc635..d6bb63474c 100644 --- a/frontend/src/app/main/data/style_dictionary.cljs +++ b/frontend/src/app/main/data/style_dictionary.cljs @@ -566,16 +566,15 @@ matching the expected behaviour in the issue. Resolved tokens are left untouched." [tokens resolved] - (let [resolved-names (set (keys resolved)) - dropped (->> tokens - (remove (fn [[k _]] (contains? resolved-names k))) - (map (fn [[k token]] - [k (assoc token - :errors - [(wte/error-with-value - :error.token/name-collision - (:name token))])])) - (into {}))] + (let [dropped (->> tokens + (remove (fn [[k _]] (contains? resolved k))) + (map (fn [[k token]] + [k (assoc token + :errors + [(wte/error-with-value + :error.token/name-collision + (:name token))])])) + (into {}))] (merge resolved dropped))) (defn resolve-tokens diff --git a/frontend/translations/en.po b/frontend/translations/en.po index fb4b609978..b981df4fb6 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -8610,7 +8610,7 @@ msgstr "Invalid token value. The resolved value is too large: %s" #: src/app/main/data/workspace/tokens/errors.cljs:60 msgid "errors.tokens.name-collision" -msgstr "Token name %s conflicts with a token group of the same name in another active set." +msgstr "Group name of %s conflicts with a token of the same name in another active set." #: src/app/main/data/workspace/tokens/errors.cljs:73, src/app/main/data/workspace/tokens/warnings.cljs:15 msgid "errors.tokens.opacity-range" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 7977d061e3..8c904a7229 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -8371,6 +8371,10 @@ msgstr "%s sets activos" msgid "errors.tokens.number-too-large" msgstr "Valor de token no valido. El valor resuelto es muy grande: %s" +#: src/app/main/data/workspace/tokens/errors.cljs:60 +msgid "errors.tokens.name-collision" +msgstr "El grupo de %s colisiona con un token del mismo nombre en otro set activo." + #: src/app/main/data/workspace/tokens/errors.cljs:73, src/app/main/data/workspace/tokens/warnings.cljs:15 msgid "errors.tokens.opacity-range" msgstr "La opacidad debe estar entre 0 y 100% o 0 y 1 (p.e. 50% o 0.5)."