대기실 보완: 만들고 아무도 안 들어간 방도 5분 뒤 정리, 거절된 채팅(도배 방지·빈 메시지)은 nonce를 담아 알려서 "보내는 중" 줄을 지우고 안내
- 회귀 테스트: 서버 2개(수정 전 코드에서 실패 확인), e2e 1단계 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,23 @@ try {
|
||||
expect((await a.getByLabel('채팅 입력').inputValue()) === '', '보낸 뒤 입력창이 비지 않음');
|
||||
});
|
||||
|
||||
await step('도배 방지를 켜면 거절된 말은 "보내는 중"으로 남지 않고 안내만 뜸', async () => {
|
||||
const site = app.settings.getSite();
|
||||
app.settings.setSite({ ...site, chatFloodGuard: true, chatRatePerSec: 1, chatBurst: 2 }, 'e2e');
|
||||
const box = b.getByLabel('채팅 입력');
|
||||
for (let i = 0; i < 5; i++) {
|
||||
await box.fill(`빠른말${i}`);
|
||||
await box.press('Enter');
|
||||
}
|
||||
await b.getByText('채팅을 너무 빨리 보내고 있어요. 잠깐 쉬었다 보내 주세요.').first().waitFor();
|
||||
await a.locator('.chat-line', { hasText: '빠른말1' }).waitFor();
|
||||
await b.waitForFunction(() => document.querySelectorAll('.chat-line.pending').length === 0, null, { timeout: 3000 });
|
||||
const shown = await a.locator('.chat-line', { hasText: '빠른말' }).count();
|
||||
expect(shown === 2, `받은 쪽에 ${shown}줄`);
|
||||
expect((await b.locator('.chat-line', { hasText: '빠른말' }).count()) === 2, '거절된 말이 보낸 쪽 화면에 남음');
|
||||
app.settings.setSite({ ...site, chatFloodGuard: false }, 'e2e');
|
||||
});
|
||||
|
||||
await step('비밀번호 방: 목록에 🔒, 들어갈 때 비밀번호(틀리면 안내), 맞으면 입장하고 지난 채팅이 보임', async () => {
|
||||
await a.getByRole('radiogroup', { name: '방 공개' }).getByRole('radio', { name: '비밀번호' }).click();
|
||||
await a.getByText('비밀번호를 정해야 잠겨요').waitFor();
|
||||
|
||||
Reference in New Issue
Block a user