Skip to content

Commit

Permalink
chore: fix linter errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raaymax committed Feb 28, 2024
1 parent 61e2bc9 commit a248ec7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ui/tests/button.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { test, expect } from "@playwright/test";

const loadPreset = async (preset) => {
await fetch(`http://localhost:7358/${preset}`);
}
};

test.describe("button", () => {
const TYPE = "button";
const COMPONENT_LOCATOR = `button.CoreButton.component`;

test.beforeAll(async() => {
await loadPreset('base');
test.beforeAll(async () => {
await loadPreset("base");
});

test.beforeEach(async ({ page }) => {
Expand Down
18 changes: 11 additions & 7 deletions ui/tests/createAndRemove.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const components = [

const loadPreset = async (preset) => {
await fetch(`http://localhost:7358/${preset}`);
}
};

components.forEach(({ type, locator }) => {
test.describe(type, () => {
const TYPE = type;
const COMPONENT_LOCATOR = locator;

test.beforeAll(async() => {
await loadPreset('base');
test.beforeAll(async () => {
await loadPreset("base");
});

test.beforeEach(async ({ page }) => {
Expand All @@ -68,14 +68,18 @@ components.forEach(({ type, locator }) => {
});

test("remove", async ({ page }) => {
await page.locator(COMPONENT_LOCATOR).click({timeout: 1000});
await page.locator(COMPONENT_LOCATOR).click({ timeout: 1000 });
await page
.locator(
'.BuilderComponentShortcuts .actionButton[data-action="delete"]',
)
.click({timeout: 1000});
await expect(page.locator(COMPONENT_LOCATOR)).not.toBeVisible({timeout: 1000});
await expect(page.locator(COMPONENT_LOCATOR)).toHaveCount(0, {timeout: 1000});
.click({ timeout: 1000 });
await expect(page.locator(COMPONENT_LOCATOR)).not.toBeVisible({
timeout: 1000,
});
await expect(page.locator(COMPONENT_LOCATOR)).toHaveCount(0, {
timeout: 1000,
});
});
});
});
6 changes: 3 additions & 3 deletions ui/tests/image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { test, expect } from "@playwright/test";

const loadPreset = async (preset) => {
await fetch(`http://localhost:7358/${preset}`);
}
};

test.describe("image", () => {
const TYPE = "image";
const COMPONENT_LOCATOR = `div.CoreImage.component`;

test.beforeAll(async() => {
await loadPreset('base');
test.beforeAll(async () => {
await loadPreset("base");
});

test.beforeEach(async ({ page }) => {
Expand Down

0 comments on commit a248ec7

Please sign in to comment.