1
0
forked from baron/baron-sso

조직도 표현 개선

This commit is contained in:
2026-05-29 10:33:15 +09:00
parent 6a6730b544
commit c489c7c38f
34 changed files with 1872 additions and 391 deletions

View File

@@ -169,6 +169,25 @@ async function makeWindowCloseNavigateToRoot(page: Page): Promise<void> {
});
}
async function enableFlutterAccessibility(page: Page): Promise<void> {
await page.waitForTimeout(300);
const button = page.getByRole('button', { name: 'Enable accessibility' });
if (await button.count()) {
await button.first().evaluate((node) => {
(node as HTMLElement).click();
});
await page.waitForTimeout(200);
return;
}
const placeholder = page.locator('flt-semantics-placeholder').first();
if (await placeholder.count()) {
await placeholder.evaluate((node) => {
(node as HTMLElement).click();
});
await page.waitForTimeout(800);
}
}
test.describe('UserFront WASM auth routing', () => {
test('비로그인 /ko 진입 시 /ko/signin 으로 리다이렉트된다', async ({ page }) => {
await mockUserfrontApis(page, { sessionStatus: 401 });
@@ -274,7 +293,7 @@ test.describe('UserFront WASM auth routing', () => {
expect(clientFailures).toEqual([]);
});
test('verifyOnly 승인 완료 버튼은 SMS 링크에서 user/me 조회나 루트 이동을 만들지 않는다', async ({
test('verifyOnly 승인 완료 버튼은 SMS 링크에서 로그인 창으로 이동하고 user/me 조회 만들지 않는다', async ({
page,
}) => {
let userMeCalls = 0;
@@ -298,20 +317,48 @@ test.describe('UserFront WASM auth routing', () => {
await expect(page).toHaveURL(/\/ko\/verify-complete$/);
expect(userMeCalls).toBe(0);
const viewport = page.viewportSize();
if (!viewport) throw new Error('viewport is required');
await page.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
await page.waitForTimeout(300);
await enableFlutterAccessibility(page);
await page.getByRole('button', { name: '로그인 창으로 이동하기' }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
expect(
clientFailures.filter(
(failure) => !failure.includes('401 (Unauthorized)'),
),
).toEqual([]);
});
test('verifyOnly 원격 승인 완료는 로그인 창 이동 모달 CTA를 표시한다', async ({
page,
}) => {
let verifyCalls = 0;
const clientFailures = collectClientFailures(page);
await mockUserfrontApis(page, {
sessionStatus: 401,
captureVerify: () => {
verifyCalls += 1;
},
});
await makeWindowCloseNavigateToRoot(page);
await page.goto('/ko/l/AB123456');
await expect.poll(() => verifyCalls, { timeout: 10_000 }).toBe(1);
await expect(page).toHaveURL(/\/ko\/verify-complete$/);
await expect(page).not.toHaveURL(/\/signin(?:\?.*)?$/);
await enableFlutterAccessibility(page);
await expect(
page.getByText('요청하신 로그인이 완료되었습니다'),
).toBeVisible();
await expect(page.getByRole('button', { name: '창 닫기' })).toHaveCount(0);
await expect(
page.getByRole('button', { name: '로그인 창으로 이동하기' }),
).toBeVisible();
await page.getByRole('button', { name: '로그인 창으로 이동하기' }).click();
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
expect(clientFailures).toEqual([]);
});
@@ -428,18 +475,13 @@ test.describe('UserFront WASM auth routing', () => {
await expect(popup).toHaveURL(/\/ko\/verify-complete$/);
expect(userMeCalls).toBe(0);
const viewport = popup.viewportSize();
if (!viewport) throw new Error('viewport is required');
if (!popup.isClosed()) {
await enableFlutterAccessibility(popup);
const closePromise = popup.waitForEvent('close').catch(() => undefined);
try {
await popup.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
await popup
.getByRole('button', { name: '로그인 창으로 이동하기' })
.click();
} catch (error) {
if (!popup.isClosed()) {
throw error;
@@ -453,7 +495,7 @@ test.describe('UserFront WASM auth routing', () => {
expect(clientFailures).toEqual([]);
});
test('verifyOnly 승인 완료 버튼은 이메일 magic link에서도 user/me 조회나 루트 이동을 만들지 않는다', async ({
test('verifyOnly 승인 완료 버튼은 이메일 magic link에서도 로그인 창으로 이동하고 user/me 조회 만들지 않는다', async ({
page,
}) => {
let userMeCalls = 0;
@@ -485,24 +527,15 @@ test.describe('UserFront WASM auth routing', () => {
verifyOnly: true,
});
const viewport = page.viewportSize();
if (!viewport) throw new Error('viewport is required');
await page.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
await page.waitForTimeout(300);
await enableFlutterAccessibility(page);
await page.getByRole('button', { name: '로그인 창으로 이동하기' }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/verify-complete$/);
await expect(page).not.toHaveURL(/\/signin(?:\?.*)?$/);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
expect(clientFailures).toEqual([]);
});
test('verifyOnly 승인 완료 버튼은 이메일 code link에서도 user/me 조회나 루트 이동을 만들지 않는다', async ({
test('verifyOnly 승인 완료 버튼은 이메일 code link에서도 로그인 창으로 이동하고 user/me 조회 만들지 않는다', async ({
page,
}) => {
let userMeCalls = 0;
@@ -538,20 +571,11 @@ test.describe('UserFront WASM auth routing', () => {
verifyOnly: true,
});
const viewport = page.viewportSize();
if (!viewport) throw new Error('viewport is required');
await page.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
await page.waitForTimeout(300);
await enableFlutterAccessibility(page);
await page.getByRole('button', { name: '로그인 창으로 이동하기' }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/verify-complete$/);
await expect(page).not.toHaveURL(/\/signin(?:\?.*)?$/);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
expect(clientFailures).toEqual([]);
});
});