fix(game-frontend): 토너먼트 새 창 닫기를 복원한다

토너먼트와 베팅장 공통 헤더의 창 닫기가 메인 라우트로 이동하지 않고 Ref처럼 현재 보조 창을 닫도록 변경한다. noopener 새 창에서 두 경로를 닫고 원래 창이 유지되는 Chromium 회귀 테스트를 추가한다.
This commit is contained in:
2026-08-22 04:59:18 +00:00
parent 55f41601e6
commit 266555355e
3 changed files with 35 additions and 9 deletions
@@ -693,6 +693,30 @@ test('tournament and betting pages expose same-row navigation tabs beside close'
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(390);
});
test('tournament and betting close only their script-opened popup window', async ({ page }, testInfo) => {
const baseURL = testInfo.project.use.baseURL;
expect(typeof baseURL).toBe('string');
await page.goto('about:blank');
for (const route of ['tournament', 'betting'] as const) {
const popupPromise = page.waitForEvent('popup');
await page.evaluate(() => window.open('about:blank', '_blank', 'noopener'));
const popup = await popupPromise;
await installFixture(popup, { tournamentStage: route === 'betting' ? 6 : 1 });
await popup.goto(new URL(route, baseURL as string).href);
await expect(popup.getByRole('button', { name: '창 닫기' }).first()).toBeVisible();
expect(await popup.evaluate(() => window.opener)).toBeNull();
const closed = popup.waitForEvent('close');
await popup.getByRole('button', { name: '창 닫기' }).first().click();
await closed;
expect(page.isClosed()).toBe(false);
expect(page.url()).toBe('about:blank');
}
});
test('mobile betting rankings use tabs and keep dedicated icons beside general names', async ({ page }, testInfo) => {
await page.setViewportSize({ width: 390, height: 844 });
const { placedBets } = await installFixture(page, { tournamentStage: 6 });
@@ -3,6 +3,8 @@ defineProps<{
activePage: 'tournament' | 'betting';
title: string;
}>();
const closeWindow = (): void => window.close();
</script>
<template>
@@ -35,15 +37,13 @@ defineProps<{
</button>
</RouterLink>
</nav>
<RouterLink v-slot="{ navigate }" custom to="/">
<button
class="legacy-button legacy-button--navigation legacy-button--fixed-height close-button"
type="button"
@click="navigate"
>
닫기
</button>
</RouterLink>
<button
class="legacy-button legacy-button--navigation legacy-button--fixed-height close-button"
type="button"
@click="closeWindow"
>
닫기
</button>
</div>
</header>
</template>
@@ -39,6 +39,8 @@ void describe('shared Lumen button family', () => {
for (const label of ['토너먼트', '베팅장', '창 닫기']) {
assert.match(tournamentHeader, new RegExp(`legacy-button[\\s\\S]{0,260}${label}`, 'u'));
}
assert.match(tournamentHeader, /const closeWindow = \(\): void => window\.close\(\)/u);
assert.doesNotMatch(tournamentHeader, /custom to="\/"/u);
assert.match(reservedEditor, /legacy-button legacy-button--info legacy-button--fixed-height select-command/u);
assert.match(reservedEditor, / /u);
});