mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 07:06:11 +02:00
Add cancel test
This commit is contained in:
parent
7bce4ab425
commit
8772cdf423
1 changed files with 5 additions and 2 deletions
|
@ -106,7 +106,7 @@ test.describe("Tokens: Tokens Tab", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe("Tokens: Sets Tab", () => {
|
test.describe("Tokens: Sets Tab", () => {
|
||||||
const createSet = async (sidebar, setName) => {
|
const createSet = async (sidebar, setName, finalKey = "Enter") => {
|
||||||
const tokensTabButton = sidebar
|
const tokensTabButton = sidebar
|
||||||
.getByRole("button", { name: "Add set" })
|
.getByRole("button", { name: "Add set" })
|
||||||
.click();
|
.click();
|
||||||
|
@ -114,7 +114,7 @@ test.describe("Tokens: Sets Tab", () => {
|
||||||
const setInput = sidebar.locator("input:focus");
|
const setInput = sidebar.locator("input:focus");
|
||||||
await expect(setInput).toBeVisible();
|
await expect(setInput).toBeVisible();
|
||||||
await setInput.fill(setName);
|
await setInput.fill(setName);
|
||||||
await setInput.press("Enter");
|
await setInput.press(finalKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
test("User creates sets tree structure by entering a set path", async ({
|
test("User creates sets tree structure by entering a set path", async ({
|
||||||
|
@ -134,6 +134,9 @@ test.describe("Tokens: Sets Tab", () => {
|
||||||
await createSet(tokenThemesSetsSidebar, "core/colors/light");
|
await createSet(tokenThemesSetsSidebar, "core/colors/light");
|
||||||
await createSet(tokenThemesSetsSidebar, "core/colors/dark");
|
await createSet(tokenThemesSetsSidebar, "core/colors/dark");
|
||||||
|
|
||||||
|
// User cancels during editing
|
||||||
|
await createSet(tokenThemesSetsSidebar, "core/colors/dark", "Escape");
|
||||||
|
|
||||||
await expect(tokenSetItems).toHaveCount(2);
|
await expect(tokenSetItems).toHaveCount(2);
|
||||||
await expect(tokenSetGroupItems).toHaveCount(2);
|
await expect(tokenSetGroupItems).toHaveCount(2);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue