Check for auto-created set

This commit is contained in:
Florian Schroedl 2024-11-25 11:10:17 +01:00
parent 439ca4b52c
commit 85fa635f66
4 changed files with 21 additions and 4 deletions

View file

@ -27,7 +27,9 @@ test.describe("Tokens: Tab", () => {
await expect(tokensTabPanel).toHaveText(/Themes/);
});
test("Created color token shows up in the sidebar", async ({ page }) => {
test("User creates color token and auto created set show up in the sidebar", async ({
page,
}) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC(
@ -83,5 +85,17 @@ test.describe("Tokens: Tab", () => {
// Tokens tab panel should have two tokens with the color red / #ff0000
await expect(tokensTabPanel.getByTitle("#ff0000")).toHaveCount(2);
// Global set has been auto created and is active
await expect(
workspacePage.tokenThemesSetsSidebar.getByRole("button", {
name: "Global",
}),
).toHaveCount(1);
await expect(
workspacePage.tokenThemesSetsSidebar.getByRole("button", {
name: "Global",
}),
).toHaveAttribute("aria-checked", "true");
});
});