대기실 게임 설정: 참여자도 보기 전용으로 전체 설정 확인

방장이 아닌 사람도 방장과 같은 설정 화면(자세한 설정 포함)을 본다.
모든 버튼·입력은 잠겨 있고 "자세한 설정" 펼치기만 된다. 휴대폰은 [설정 보기],
PC는 카드 안에 바로 펼침. 서버는 이미 방장 외 config를 거절한다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-11 01:44:20 +09:00
parent ebf82fd105
commit 27ed513011
4 changed files with 77 additions and 15 deletions

View File

@@ -96,6 +96,21 @@ try {
await a.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await b.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await a.screenshot({ path: join(SHOTS, '1-lobby-pc.png') });
// B (not host) can open the same settings, read-only: the host's choices show, nothing can be pressed,
// and "자세한 설정" still opens so the hidden rules can be read too.
await b.getByText('설정은 방장만 바꿀 수 있어요').first().waitFor();
if (await b.getByRole('button', { name: '설정 바꾸기' }).count()) throw new Error('non-host sees 설정 바꾸기');
await b.getByRole('button', { name: '설정 보기' }).click();
const sheet = b.getByRole('dialog', { name: '게임 설정' });
const free = sheet.getByRole('button', { name: '자유룰' });
if ((await free.getAttribute('aria-pressed')) !== 'true' || !(await free.isDisabled())) throw new Error('read-only 자유룰 not shown as chosen + locked');
if (!(await sheet.getByRole('button', { name: '렌주룰' }).isDisabled())) throw new Error('non-host can press 렌주룰');
if (!(await sheet.getByRole('button', { name: '허용' }).isDisabled())) throw new Error('non-host can press 관전 허용');
await sheet.getByRole('button', { name: '▼ 자세한 설정' }).click();
if (!(await sheet.getByRole('button', { name: '19줄' }).isDisabled())) throw new Error('non-host can press 19줄 (자세한 설정)');
await b.screenshot({ path: join(SHOTS, '5b-lobby-phone-settings-view.png') });
await sheet.getByRole('button', { name: '닫기', exact: true }).click();
await b.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await a.getByRole('button', { name: '▶ 게임 시작' }).click();
await a.getByRole('button', { name: '시작하기' }).click();
await a.getByText('내 차례예요').waitFor();