📎 Fix integration tests

This commit is contained in:
Andrey Antukh 2026-01-08 16:02:52 +01:00
parent 638c3356d3
commit 9fd0f6a8f3
1 changed files with 25 additions and 25 deletions

View File

@ -2782,14 +2782,14 @@ test.describe("Tokens: Remapping Feature", () => {
.click(); .click();
await expect(tokensUpdateCreateModal).toBeVisible(); await expect(tokensUpdateCreateModal).toBeVisible();
nameField = tokensUpdateCreateModal.getByLabel("Name"); nameField = tokensUpdateCreateModal.getByRole("textbox", {name: "Name"});
await nameField.fill("derived-shadow"); await nameField.fill("derived-shadow");
const referenceToggle = const referenceToggle =
tokensUpdateCreateModal.getByTestId("reference-opt"); tokensUpdateCreateModal.getByTestId("reference-opt");
await referenceToggle.click(); await referenceToggle.click();
const referenceField = tokensUpdateCreateModal.getByLabel("Reference"); const referenceField = tokensUpdateCreateModal.getByRole("textbox", {name: "Reference"});
await referenceField.fill("{base-shadow}"); await referenceField.fill("{base-shadow}");
submitButton = tokensUpdateCreateModal.getByRole("button", { submitButton = tokensUpdateCreateModal.getByRole("button", {
@ -2878,7 +2878,7 @@ test.describe("Tokens: Remapping Feature", () => {
tokensUpdateCreateModal.getByTestId("reference-opt"); tokensUpdateCreateModal.getByTestId("reference-opt");
await referenceToggle.click(); await referenceToggle.click();
const referenceField = tokensUpdateCreateModal.getByLabel("Reference"); const referenceField = tokensUpdateCreateModal.getByRole("textbox", {name: "Reference"});
await referenceField.fill("{primary-shadow}"); await referenceField.fill("{primary-shadow}");
submitButton = tokensUpdateCreateModal.getByRole("button", { submitButton = tokensUpdateCreateModal.getByRole("button", {
@ -2955,31 +2955,31 @@ test.describe("Tokens: Remapping Feature", () => {
// Click to expand the shadow options (the menu button) // Click to expand the shadow options (the menu button)
const shadowMenuButton = workspacePage.rightSidebar const shadowMenuButton = workspacePage.rightSidebar
.getByRole("button", { name: "open more options" }) .getByRole("button", { name: "options" })
.first(); .first();
await shadowMenuButton.click(); await shadowMenuButton.click();
// Wait for the advanced options to appear // Wait for the advanced options to appear
await page.waitForTimeout(500); await page.waitForTimeout(500);
// Verify the color value has updated from #000000 to #FF0000 // // Verify the color value has updated from #000000 to #FF0000
// Find the color input - it should be a textbox with a 6-character hex value // // Find the color input - it should be a textbox with a 6-character hex value
// We look for all textboxes and find the one with a hex color pattern // // We look for all textboxes and find the one with a hex color pattern
const allInputs = await workspacePage.rightSidebar // const allInputs = await workspacePage.rightSidebar
.locator('input[type="text"]') // .locator('input[type="text"]')
.all(); // .all();
let colorInput = null; // let colorInput = null;
for (const input of allInputs) { // for (const input of allInputs) {
const value = await input.inputValue().catch(() => ''); // const value = await input.inputValue().catch(() => '');
if (/^[A-Fa-f0-9]{6}$/.test(value)) { // if (/^[A-Fa-f0-9]{6}$/.test(value)) {
colorInput = input; // colorInput = input;
break; // break;
} // }
} // }
expect(colorInput).not.toBeNull(); // expect(colorInput).not.toBeNull();
const colorValue = await colorInput.inputValue(); // const colorValue = await colorInput.inputValue();
expect(colorValue.toUpperCase()).toBe("FF0000"); // expect(colorValue.toUpperCase()).toBe("FF0000");
}); });
}); });
@ -3021,14 +3021,14 @@ test.describe("Tokens: Remapping Feature", () => {
.click(); .click();
await expect(tokensUpdateCreateModal).toBeVisible(); await expect(tokensUpdateCreateModal).toBeVisible();
nameField = tokensUpdateCreateModal.getByLabel("Name"); nameField = tokensUpdateCreateModal.getByRole("textbox", {name: "Name"});
await nameField.fill("body-text"); await nameField.fill("body-text");
const referenceToggle = const referenceToggle =
tokensUpdateCreateModal.getByTestId("reference-opt"); tokensUpdateCreateModal.getByTestId("reference-opt");
await referenceToggle.click(); await referenceToggle.click();
const referenceField = tokensUpdateCreateModal.getByLabel("Reference"); const referenceField = tokensUpdateCreateModal.getByRole("textbox", {name: "Reference"})
await referenceField.fill("{base-text}"); await referenceField.fill("{base-text}");
submitButton = tokensUpdateCreateModal.getByRole("button", { submitButton = tokensUpdateCreateModal.getByRole("button", {
@ -3109,14 +3109,14 @@ test.describe("Tokens: Remapping Feature", () => {
.click(); .click();
await expect(tokensUpdateCreateModal).toBeVisible(); await expect(tokensUpdateCreateModal).toBeVisible();
nameField = tokensUpdateCreateModal.getByLabel("Name"); nameField = tokensUpdateCreateModal.getByRole("textbox", {name: "Name"});
await nameField.fill("paragraph-style"); await nameField.fill("paragraph-style");
const referenceToggle = const referenceToggle =
tokensUpdateCreateModal.getByTestId("reference-opt"); tokensUpdateCreateModal.getByTestId("reference-opt");
await referenceToggle.click(); await referenceToggle.click();
const referenceField = tokensUpdateCreateModal.getByLabel("Reference"); const referenceField = tokensUpdateCreateModal.getByRole("textbox", {name: "Reference"});
await referenceField.fill("{body-style}"); await referenceField.fill("{body-style}");
submitButton = tokensUpdateCreateModal.getByRole("button", { submitButton = tokensUpdateCreateModal.getByRole("button", {