1
0
forked from baron/baron-sso
Files
baron-sso/devfront/tests/clients.spec.ts

55 lines
1.5 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { seedAuth } from "./helpers/devfront-fixtures";
test("clients page loads correctly", async ({ page }) => {
await seedAuth(page);
await page.route("**/api/v1/dev/clients**", async (route) => {
if (route.request().method() !== "GET") {
await route.fulfill({
status: 404,
contentType: "application/json",
body: JSON.stringify({ error: "Not found" }),
});
return;
}
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
items: [
{
id: "client-playwright",
name: "Playwright Client",
type: "private",
status: "active",
createdAt: new Date().toISOString(),
redirectUris: ["http://localhost:5174/callback"],
scopes: ["openid", "profile", "email"],
},
],
limit: 50,
offset: 0,
}),
});
});
await page.goto("/clients");
await expect(page).toHaveURL(/\/clients$/);
// 타이틀 확인
await expect(page).toHaveTitle(/바론 개발자 서비스/);
// 페이지 내 주요 텍스트 확인
await expect(page.getByText("연동 앱 목록")).toBeVisible();
// 테이블 헤더 확인
await expect(
page.getByRole("columnheader", { name: "애플리케이션" }),
).toBeVisible();
await expect(
page.getByRole("columnheader", { name: "Client ID" }),
).toBeVisible();
});