diff --git a/adminfront/src/components/ui/avatar.test.tsx b/adminfront/src/components/ui/avatar.test.tsx index ac6591d8..42175b64 100644 --- a/adminfront/src/components/ui/avatar.test.tsx +++ b/adminfront/src/components/ui/avatar.test.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import type React from "react"; import { act } from "react"; import { createRoot } from "react-dom/client"; import { afterEach, describe, expect, it } from "vitest"; diff --git a/adminfront/src/components/ui/separator.test.tsx b/adminfront/src/components/ui/separator.test.tsx index 45866cce..10bbd51a 100644 --- a/adminfront/src/components/ui/separator.test.tsx +++ b/adminfront/src/components/ui/separator.test.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import type React from "react"; import { act } from "react"; import { createRoot } from "react-dom/client"; import { afterEach, describe, expect, it } from "vitest"; diff --git a/adminfront/tests/audit.spec.ts b/adminfront/tests/audit.spec.ts index 4780fc2c..e4aa351f 100644 --- a/adminfront/tests/audit.spec.ts +++ b/adminfront/tests/audit.spec.ts @@ -120,8 +120,10 @@ test.describe("Audit Logs Management", () => { const responsePromise = page.waitForResponse(/.*\/api\/v1\/audit.*/); await page.goto("/audit-logs"); await responsePromise; - - await expect(page.locator("tbody tr").first()).toBeVisible({ timeout: 15000 }); + + await expect(page.locator("tbody tr").first()).toBeVisible({ + timeout: 15000, + }); await expect(page.locator("tbody tr")).toHaveCount(20); const loadMoreBtn = page.getByRole("button", { @@ -129,7 +131,7 @@ test.describe("Audit Logs Management", () => { }); await expect(loadMoreBtn).toBeVisible({ timeout: 10000 }); await expect(loadMoreBtn).toBeEnabled(); - + const nextResponsePromise = page.waitForResponse(/.*\/api\/v1\/audit.*/); await loadMoreBtn.click(); await nextResponsePromise; @@ -144,7 +146,9 @@ test.describe("Audit Logs Management", () => { await page.goto("/audit-logs"); await responsePromise; - await expect(page.locator("tbody tr").first()).toBeVisible({ timeout: 15000 }); + await expect(page.locator("tbody tr").first()).toBeVisible({ + timeout: 15000, + }); await expect(page.locator("tbody tr")).toHaveCount(20); // Search by User ID @@ -174,7 +178,9 @@ test.describe("Audit Logs Management", () => { await page.goto("/audit-logs"); await responsePromise; - await expect(page.locator("tbody tr").first()).toBeVisible({ timeout: 15000 }); + await expect(page.locator("tbody tr").first()).toBeVisible({ + timeout: 15000, + }); await expect(page.locator("tbody tr")).toHaveCount(20); // Select "Failure" status diff --git a/adminfront/tests/tenants.spec.ts b/adminfront/tests/tenants.spec.ts index 9390ca9b..8a59aa19 100644 --- a/adminfront/tests/tenants.spec.ts +++ b/adminfront/tests/tenants.spec.ts @@ -1,4 +1,4 @@ -import { expect, test } from "@playwright/test"; +import { type Download, expect, test } from "@playwright/test"; test.describe("Tenants Management", () => { test.beforeEach(async ({ page }) => { @@ -731,9 +731,11 @@ test.describe("Tenants Management", () => { const item = page.getByTestId(testId); await item.waitFor({ state: "attached" }); - let downloadObj; + let downloadObj: Download; await expect(async () => { - const downloadPromise = page.waitForEvent("download", { timeout: 10000 }); + const downloadPromise = page.waitForEvent("download", { + timeout: 10000, + }); // Use dispatchEvent for more reliable trigger in webkit await item.dispatchEvent("click"); downloadObj = await downloadPromise; @@ -750,9 +752,7 @@ test.describe("Tenants Management", () => { await expect( page.getByTestId("tenant-export-with-ids-menu-item"), ).toBeVisible(); - const exportWithIdsDownload = await safeDownload( - "tenant-export-with-ids-menu-item", - ); + await safeDownload("tenant-export-with-ids-menu-item"); expect(exportUrl).toContain("includeIds=true"); await openDataManagementMenu(); diff --git a/adminfront/tests/users_bulk_secondary.spec.ts b/adminfront/tests/users_bulk_secondary.spec.ts index 59834a14..22ab112f 100644 --- a/adminfront/tests/users_bulk_secondary.spec.ts +++ b/adminfront/tests/users_bulk_secondary.spec.ts @@ -118,7 +118,7 @@ test.describe("Users Bulk Upload Secondary Emails", () => { expect(bulkPayload.users).toHaveLength(1); // The most important check - does it parse to the metadata - expect(bulkPayload!.users[0].metadata.sub_email).toContain("sub1@test.com"); - expect(bulkPayload!.users[0].metadata.sub_email).toContain("sub2@test.com"); + expect(bulkPayload?.users[0].metadata.sub_email).toContain("sub1@test.com"); + expect(bulkPayload?.users[0].metadata.sub_email).toContain("sub2@test.com"); }); });