From a248ec73a37d6d898c4ec66e78975f37c8a15a1f Mon Sep 17 00:00:00 2001 From: Mateusz Russak Date: Wed, 28 Feb 2024 11:05:55 +0100 Subject: [PATCH] chore: fix linter errors in tests --- ui/tests/button.spec.ts | 6 +++--- ui/tests/createAndRemove.spec.ts | 18 +++++++++++------- ui/tests/image.spec.ts | 6 +++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ui/tests/button.spec.ts b/ui/tests/button.spec.ts index 8ef43705e..aca61f99d 100644 --- a/ui/tests/button.spec.ts +++ b/ui/tests/button.spec.ts @@ -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 }) => { diff --git a/ui/tests/createAndRemove.spec.ts b/ui/tests/createAndRemove.spec.ts index d6eec57dc..0577b2bb4 100644 --- a/ui/tests/createAndRemove.spec.ts +++ b/ui/tests/createAndRemove.spec.ts @@ -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 }) => { @@ -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, + }); }); }); }); diff --git a/ui/tests/image.spec.ts b/ui/tests/image.spec.ts index 3340f0506..35b40ac5e 100644 --- a/ui/tests/image.spec.ts +++ b/ui/tests/image.spec.ts @@ -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 }) => {