채팅 연속 입력 전부 전송(짧은 연타 허용 + 보내기 대기열), 사람도 '입력 중' 표시, 오른쪽 위 소리 크기(0~100, 기본 50)

- 서버 방 채팅: 0.5초 고정 간격 대신 토큰 버킷(4줄 연속, 초당 2줄) — 도배는 여전히 막음
- 웹: useChatOutbox(방 채팅·마피아·라이어 게임)로 빠르게 친 줄도 순서대로 전송
- typing 메시지(방 채팅 / 게임 공개 채팅만, 마피아 밤 채널은 보내지 않음), BotActivity에 사람 표시
- VolumeControl: 사이트 머리글·방 막대 오른쪽 위, 설정 페이지에도 슬라이더
- e2e/chat.e2e.ts: 연타 7줄, 입력 중, 소리 크기

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 04:14:19 +09:00
parent f12cf12b84
commit f620faf70b
17 changed files with 415 additions and 21 deletions

View File

@@ -163,6 +163,57 @@ try {
await b.getByRole('button', { name: '채팅', exact: true }).waitFor();
});
await step('빠르게 여러 번 Enter: 전부 순서대로 들어감', async () => {
await a.waitForTimeout(1500);
const input = a.locator('.chat-panel input[aria-label="메시지"]').first();
for (let i = 1; i <= 7; i++) {
await input.fill(`연타 ${i}`);
await input.press('Enter');
}
for (let i = 1; i <= 7; i++) await a.locator('.chat-line', { hasText: `연타 ${i}` }).waitFor({ timeout: 10_000 });
const got = await a.locator('.chat-line .chat-text', { hasText: /^연타 \d$/ }).allInnerTexts();
if (got.join(',') !== [1, 2, 3, 4, 5, 6, 7].map((i) => `연타 ${i}`).join(',')) throw new Error(`order/lost: ${got.join(',')}`);
// The other side got them all too (phone sheet closed: the badge counts 7).
await b.getByRole('button', { name: '채팅, 새 메시지 7개' }).waitFor({ timeout: 5000 });
});
await step('사람도 "입력 중" 표시: 치는 동안 보이고, 보내면 사라짐', async () => {
const input = a.locator('.chat-panel input[aria-label="메시지"]').first();
await input.fill('지금 치는 중');
await b.getByRole('button', { name: /^채팅/ }).click();
const sheet = b.getByRole('dialog', { name: '채팅' });
await sheet.locator('[data-person]', { hasText: '호랑이 입력 중' }).waitFor({ timeout: 5000 });
await b.waitForTimeout(300);
await b.screenshot({ path: join(SHOTS, 'chat-typing-phone.png') });
await input.press('Enter');
await sheet.locator('[data-person]').waitFor({ state: 'detached', timeout: 5000 });
// Nobody sees their own typing.
await sheet.locator('input[aria-label="메시지"]').fill('나도 치는 중');
await a.locator('[data-person]', { hasText: '고양이 입력 중' }).waitFor({ timeout: 5000 });
if (await b.locator('[data-person]', { hasText: '고양이' }).count()) throw new Error('sees own typing');
await sheet.locator('input[aria-label="메시지"]').fill('');
await a.locator('[data-person]').waitFor({ state: 'detached', timeout: 5000 });
await sheet.getByRole('button', { name: '닫기' }).click();
});
await step('소리 크기: 방 막대 오른쪽 위, 기본 50, 0~100', async () => {
const btn = a.locator('.room-bar').getByRole('button', { name: /^소리 크기/ });
if ((await btn.getAttribute('aria-label')) !== '소리 크기 50') throw new Error(`default: ${await btn.getAttribute('aria-label')}`);
await btn.click();
const slider = a.getByRole('slider', { name: '소리 크기 (0~100)' });
if ((await slider.getAttribute('min')) !== '0' || (await slider.getAttribute('max')) !== '100') throw new Error('range');
await slider.fill('30');
await a.locator('.room-bar').getByRole('button', { name: '소리 크기 30' }).waitFor();
await a.waitForTimeout(300);
await a.screenshot({ path: join(SHOTS, 'volume-room-pc.png') });
await a.keyboard.press('Escape');
const saved = await a.evaluate(() => JSON.parse(localStorage.getItem('bg.settings') ?? '{}').volume);
if (saved !== 30) throw new Error(`not saved: ${saved}`);
// Phone room bar has it too.
await b.locator('.room-bar').getByRole('button', { name: /^소리 크기/ }).waitFor();
await b.screenshot({ path: join(SHOTS, 'volume-roombar-phone.png') });
});
await step('게임 중(PC 옆 칸): 새 메시지마다 맨 아래', async () => {
await a.getByRole('button', { name: '▶ 게임 시작' }).click();
await a.getByRole('button', { name: '시작하기' }).click();