fix(game-frontend): 토너먼트 새 창 닫기를 복원한다
토너먼트와 베팅장 공통 헤더의 창 닫기가 메인 라우트로 이동하지 않고 Ref처럼 현재 보조 창을 닫도록 변경한다. noopener 새 창에서 두 경로를 닫고 원래 창이 유지되는 Chromium 회귀 테스트를 추가한다.
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user