채팅 소리 기본 크기를 게임 소리의 80%로 올리고(60%는 너무 안 들린다는 의견), 관리자 사이트 설정에 "채팅 소리 크기"(게임 소리의 0~200%, 정수, 기본 80%)를 추가. 0%면 채팅 소리 없음. 각자의 소리 크기(0~100)는 그대로 곱해짐. 저장하면 /api/config와 방 정보(RoomView.chatSound)로 열린 방에도 바로 적용. 설정 화면에 저장 없이 그 값으로 울려 보는 "들어 보기" 버튼. feedback.test.ts·admin.test.ts·admin.e2e.ts에 확인 추가, docs/14-admin.md 표에 항목 추가
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -223,6 +223,32 @@ describe('site settings, rooms, users', () => {
|
||||
expect((await next).room.gameSpeed).toBe(2);
|
||||
});
|
||||
|
||||
test('chat sound: 0~200% (default 80), shown in /api/config and open rooms, out of range rejected', async () => {
|
||||
const s = start();
|
||||
const sup = await discordLogin(s, SUPER);
|
||||
const site = (await api(s.base, '/api/admin/site', { cookie: sup.cookie })).body.site;
|
||||
expect(site.chatSound).toBe(80);
|
||||
expect((await api(s.base, '/api/config')).body.chatSound).toBe(80);
|
||||
for (const bad of [-1, 201, 50.5]) {
|
||||
const r = await api(s.base, '/api/admin/site', { method: 'PUT', cookie: sup.cookie, body: JSON.stringify({ ...site, chatSound: bad }) });
|
||||
expect(r.res.status).toBe(400);
|
||||
}
|
||||
for (const ok of [0, 200, 120]) {
|
||||
const r = await api(s.base, '/api/admin/site', { method: 'PUT', cookie: sup.cookie, body: JSON.stringify({ ...site, chatSound: ok }) });
|
||||
expect(r.res.status).toBe(200);
|
||||
expect((await api(s.base, '/api/config')).body.chatSound).toBe(ok);
|
||||
}
|
||||
const g = await guest(s.base, '방장님');
|
||||
const room = await api(s.base, '/api/rooms', { method: 'POST', cookie: g.cookie, body: JSON.stringify({ gameId: 'omok' }) });
|
||||
const c = await new Client(s.base, g.cookie, g.id).connect();
|
||||
clients.push(c);
|
||||
c.send({ t: 'join', code: room.body.code, as: 'player' });
|
||||
expect((await c.next('room')).room.chatSound).toBe(120);
|
||||
const next = c.next('room');
|
||||
await api(s.base, '/api/admin/site', { method: 'PUT', cookie: sup.cookie, body: JSON.stringify({ ...site, chatSound: 30 }) });
|
||||
expect((await next).room.chatSound).toBe(30);
|
||||
});
|
||||
|
||||
test('admin closes a room: everyone is told and disconnected from it', async () => {
|
||||
const s = start();
|
||||
const sup = await discordLogin(s, SUPER);
|
||||
|
||||
Reference in New Issue
Block a user