mirror of
https://github.com/penpot/penpot.git
synced 2026-05-01 22:28:15 +00:00
🐛 Add test to catch a fixed bug and avoid regressions
This commit is contained in:
parent
6c7661b04d
commit
5f22220a8b
@ -36,6 +36,7 @@ const setupEmptyTokensFile = async (page, options = {}) => {
|
||||
|
||||
return {
|
||||
workspacePage,
|
||||
tokenThemeUpdateCreateModal: workspacePage.tokenThemeUpdateCreateModal,
|
||||
tokensUpdateCreateModal: workspacePage.tokensUpdateCreateModal,
|
||||
tokenThemesSetsSidebar: workspacePage.tokenThemesSetsSidebar,
|
||||
tokenSetItems: workspacePage.tokenSetItems,
|
||||
@ -818,6 +819,41 @@ test.describe("Tokens: Themes modal", () => {
|
||||
).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("Add new theme in empty file", async ({ page }) => {
|
||||
const { tokenThemesSetsSidebar, tokenThemeUpdateCreateModal } =
|
||||
await setupEmptyTokensFile(page);
|
||||
|
||||
await tokenThemesSetsSidebar
|
||||
.getByRole("button", { name: "Create one." })
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await expect(
|
||||
tokenThemeUpdateCreateModal
|
||||
).toBeVisible();
|
||||
|
||||
const groupInput = tokenThemeUpdateCreateModal.getByLabel("Group");
|
||||
const nameInput = tokenThemeUpdateCreateModal.getByLabel("Theme");
|
||||
const saveButton = tokenThemeUpdateCreateModal.getByRole("button", {
|
||||
name: "Save theme",
|
||||
});
|
||||
|
||||
await groupInput.fill("New Group name");
|
||||
await nameInput.fill("New Theme name");
|
||||
|
||||
await checkInputFieldWithoutError(tokenThemeUpdateCreateModal, nameInput);
|
||||
await expect(saveButton).not.toBeDisabled();
|
||||
|
||||
await saveButton.click();
|
||||
|
||||
await expect(
|
||||
tokenThemeUpdateCreateModal.getByText("New Theme name"),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
tokenThemeUpdateCreateModal.getByText("New Group name"),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("Add new theme", async ({ page }) => {
|
||||
const { tokenThemeUpdateCreateModal, workspacePage } =
|
||||
await setupTokensFile(page);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user