1
0
forked from baron/baron-sso

Biome 및 Go 포맷 적용

This commit is contained in:
2026-03-04 09:44:12 +09:00
parent 0ad57ab69c
commit dc9332809b
5 changed files with 36 additions and 15 deletions

View File

@@ -1,10 +1,10 @@
import { expect, test } from "@playwright/test";
import {
type AuditLog,
type Consent,
installDevApiMock,
makeClient,
seedAuth,
type AuditLog,
type Consent,
} from "./helpers/devfront-fixtures";
test.describe("DevFront audit logs", () => {
@@ -85,7 +85,9 @@ test.describe("DevFront audit logs", () => {
await installDevApiMock(page, state);
await page.goto("/clients/new");
await page.getByPlaceholder("My Awesome Application").fill("Realtime New App");
await page
.getByPlaceholder("My Awesome Application")
.fill("Realtime New App");
await page
.getByPlaceholder(/https:\/\/app\.example\.com\/callback/i)
.fill("https://realtime.example.com/callback");
@@ -93,7 +95,9 @@ test.describe("DevFront audit logs", () => {
await expect.poll(() => state.auditLogs.length).toBeGreaterThanOrEqual(1);
await page.goto("/clients/client-realtime/settings");
await page.getByPlaceholder("My Awesome Application").fill("Realtime Updated");
await page
.getByPlaceholder("My Awesome Application")
.fill("Realtime Updated");
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
await expect.poll(() => state.auditLogs.length).toBeGreaterThanOrEqual(2);

View File

@@ -1,10 +1,10 @@
import { expect, test } from "@playwright/test";
import {
type ClientStatus,
type Consent,
installDevApiMock,
makeClient,
seedAuth,
type ClientStatus,
type Consent,
} from "./helpers/devfront-fixtures";
test.describe("DevFront clients lifecycle", () => {
@@ -109,9 +109,9 @@ test.describe("DevFront clients lifecycle", () => {
.getByRole("button", { name: /Redirect URIs 저장|Save/i })
.click();
await expect.poll(() => state.clients[0]?.redirectUris[0]).toBe(
"https://after.example.com/callback",
);
await expect
.poll(() => state.clients[0]?.redirectUris[0])
.toBe("https://after.example.com/callback");
await page.reload();
await expect(

View File

@@ -43,13 +43,19 @@ export type AuditLog = {
export type DevApiMockState = {
clients: Client[];
consents: Consent[];
auditLogsByCursor?: Record<string, { items: AuditLog[]; next_cursor?: string }>;
auditLogsByCursor?: Record<
string,
{ items: AuditLog[]; next_cursor?: string }
>;
auditLogs?: AuditLog[];
onUpdateStatus?: (status: ClientStatus) => void;
onRotateSecret?: (newSecret: string) => void;
};
export function makeClient(id: string, overrides: Partial<Client> = {}): Client {
export function makeClient(
id: string,
overrides: Partial<Client> = {},
): Client {
return {
id,
name: `${id} app`,
@@ -301,7 +307,9 @@ export async function installDevApiMock(page: Page, state: DevApiMockState) {
const status = searchParams.get("status") || "";
const items = state.consents.filter((row) => {
const matchesSubject =
!subject || row.subject.includes(subject) || row.userName.includes(subject);
!subject ||
row.subject.includes(subject) ||
row.userName.includes(subject);
const matchesClientId = !clientId || row.clientId === clientId;
const matchesStatus = !status || row.status === status;
return matchesSubject && matchesClientId && matchesStatus;
@@ -347,7 +355,8 @@ export async function installDevApiMock(page: Page, state: DevApiMockState) {
};
} catch {}
const matchesAction = !action || parsedDetails.action === action;
const matchesClient = !clientId || parsedDetails.target_id === clientId;
const matchesClient =
!clientId || parsedDetails.target_id === clientId;
const matchesStatus = !status || item.status === status;
return matchesAction && matchesClient && matchesStatus;
});