mirror of
https://github.com/penpot/penpot.git
synced 2025-02-01 03:49:22 -05: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", () => {
|
||||
const createSet = async (sidebar, setName) => {
|
||||
const createSet = async (sidebar, setName, finalKey = "Enter") => {
|
||||
const tokensTabButton = sidebar
|
||||
.getByRole("button", { name: "Add set" })
|
||||
.click();
|
||||
|
@ -114,7 +114,7 @@ test.describe("Tokens: Sets Tab", () => {
|
|||
const setInput = sidebar.locator("input:focus");
|
||||
await expect(setInput).toBeVisible();
|
||||
await setInput.fill(setName);
|
||||
await setInput.press("Enter");
|
||||
await setInput.press(finalKey);
|
||||
};
|
||||
|
||||
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/dark");
|
||||
|
||||
// User cancels during editing
|
||||
await createSet(tokenThemesSetsSidebar, "core/colors/dark", "Escape");
|
||||
|
||||
await expect(tokenSetItems).toHaveCount(2);
|
||||
await expect(tokenSetGroupItems).toHaveCount(2);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue