forked from baron/baron-sso
fix(adminfront): resolve biome lint errors and refine test stability
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import type React from "react";
|
||||||
import { act } from "react";
|
import { act } from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import { afterEach, describe, expect, it } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import type React from "react";
|
||||||
import { act } from "react";
|
import { act } from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import { afterEach, describe, expect, it } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
|
|||||||
@@ -121,7 +121,9 @@ test.describe("Audit Logs Management", () => {
|
|||||||
await page.goto("/audit-logs");
|
await page.goto("/audit-logs");
|
||||||
await responsePromise;
|
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);
|
await expect(page.locator("tbody tr")).toHaveCount(20);
|
||||||
|
|
||||||
const loadMoreBtn = page.getByRole("button", {
|
const loadMoreBtn = page.getByRole("button", {
|
||||||
@@ -144,7 +146,9 @@ test.describe("Audit Logs Management", () => {
|
|||||||
await page.goto("/audit-logs");
|
await page.goto("/audit-logs");
|
||||||
await responsePromise;
|
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);
|
await expect(page.locator("tbody tr")).toHaveCount(20);
|
||||||
|
|
||||||
// Search by User ID
|
// Search by User ID
|
||||||
@@ -174,7 +178,9 @@ test.describe("Audit Logs Management", () => {
|
|||||||
await page.goto("/audit-logs");
|
await page.goto("/audit-logs");
|
||||||
await responsePromise;
|
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);
|
await expect(page.locator("tbody tr")).toHaveCount(20);
|
||||||
|
|
||||||
// Select "Failure" status
|
// Select "Failure" status
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { expect, test } from "@playwright/test";
|
import { type Download, expect, test } from "@playwright/test";
|
||||||
|
|
||||||
test.describe("Tenants Management", () => {
|
test.describe("Tenants Management", () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
@@ -731,9 +731,11 @@ test.describe("Tenants Management", () => {
|
|||||||
const item = page.getByTestId(testId);
|
const item = page.getByTestId(testId);
|
||||||
await item.waitFor({ state: "attached" });
|
await item.waitFor({ state: "attached" });
|
||||||
|
|
||||||
let downloadObj;
|
let downloadObj: Download;
|
||||||
await expect(async () => {
|
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
|
// Use dispatchEvent for more reliable trigger in webkit
|
||||||
await item.dispatchEvent("click");
|
await item.dispatchEvent("click");
|
||||||
downloadObj = await downloadPromise;
|
downloadObj = await downloadPromise;
|
||||||
@@ -750,9 +752,7 @@ test.describe("Tenants Management", () => {
|
|||||||
await expect(
|
await expect(
|
||||||
page.getByTestId("tenant-export-with-ids-menu-item"),
|
page.getByTestId("tenant-export-with-ids-menu-item"),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
const exportWithIdsDownload = await safeDownload(
|
await safeDownload("tenant-export-with-ids-menu-item");
|
||||||
"tenant-export-with-ids-menu-item",
|
|
||||||
);
|
|
||||||
expect(exportUrl).toContain("includeIds=true");
|
expect(exportUrl).toContain("includeIds=true");
|
||||||
|
|
||||||
await openDataManagementMenu();
|
await openDataManagementMenu();
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ test.describe("Users Bulk Upload Secondary Emails", () => {
|
|||||||
expect(bulkPayload.users).toHaveLength(1);
|
expect(bulkPayload.users).toHaveLength(1);
|
||||||
|
|
||||||
// The most important check - does it parse to the metadata
|
// 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("sub1@test.com");
|
||||||
expect(bulkPayload!.users[0].metadata.sub_email).toContain("sub2@test.com");
|
expect(bulkPayload?.users[0].metadata.sub_email).toContain("sub2@test.com");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user