mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 06:27:33 +02:00
🐛 Fix error when there exists a tokens lib with no sets
This commit is contained in:
parent
8f840daa91
commit
4fddf34a73
2 changed files with 20 additions and 3 deletions
|
@ -529,6 +529,14 @@ test.describe("Tokens: Sets Tab", () => {
|
|||
await changeSetInput(sidebar, setName, (finalKey = "Enter"));
|
||||
};
|
||||
|
||||
const assertEmptySetsList = async (el) => {
|
||||
const buttons = await el.getByRole("button").allTextContents();
|
||||
const filteredButtons = buttons.filter(
|
||||
(text) => text === "Create one.",
|
||||
);
|
||||
await expect(filteredButtons.length).toEqual(2); // We assume there are no themes, so we have two "Create one" buttons.
|
||||
};
|
||||
|
||||
const assertSetsList = async (el, sets) => {
|
||||
const buttons = await el.getByRole("button").allTextContents();
|
||||
const filteredButtons = buttons.filter(
|
||||
|
@ -623,6 +631,15 @@ test.describe("Tokens: Sets Tab", () => {
|
|||
"sizes",
|
||||
"small",
|
||||
]);
|
||||
|
||||
// User deletes all sets
|
||||
await tokenThemesSetsSidebar
|
||||
.getByRole("button", { name: "core" })
|
||||
.click({ button: "right" });
|
||||
await expect(tokenContextMenuForSet).toBeVisible();
|
||||
await tokenContextMenuForSet.getByText("Delete").click();
|
||||
|
||||
await assertEmptySetsList(tokenThemesSetsSidebar);
|
||||
});
|
||||
|
||||
test("User can create & edit sets and set groups with an identical name", async ({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue