Extract dashboard SettingsPanel component (#68)
* review: harden readonly git checks and lint verification * test: satisfy readonly reviewer sandbox typing * test: fix readonly reviewer sandbox assertions * test: remove impossible readonly sandbox guards * test: relax readonly sandbox assertions * test: cast readonly sandbox expectation shape * test: cast readonly sandbox expectation through unknown * Phase 0 — STEP_DONE/TASK_DONE split + owner-follow-up integration smoke * Add STEP_DONE guards, verdict storage, and stale delivery suppression * style: format paired stepdone telemetry files * Route STEP_DONE through reviewer * Add structured Discord attachments * style: format structured attachment test * Fix room thread bot output parity * Remove duplicate work item attachment migration from owner branch * Remove legacy dashboard rooms renderer * Extract dashboard parsed body renderer * Extract dashboard redaction helpers * Extract dashboard RoomCardV2 component * Include RoomCardV2 test in vitest suite * Extract dashboard RoomBoardV2 component * Extract dashboard EmptyState component * Extract dashboard InboxPanel component * Split dashboard InboxPanel card renderer * Extract dashboard TaskPanel component * Extract dashboard UsagePanel component * Fix dashboard room thread chunk rendering * Extract dashboard ServicePanel component * Render dashboard live progress markdown * Extract dashboard SettingsPanel component
This commit is contained in:
42
apps/dashboard/src/SettingsPanel.test.ts
Normal file
42
apps/dashboard/src/SettingsPanel.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { createElement } from 'react';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { messages } from './i18n';
|
||||
import { SettingsPanel, type SettingsPanelProps } from './SettingsPanel';
|
||||
|
||||
const t = messages.en;
|
||||
|
||||
const baseProps: SettingsPanelProps = {
|
||||
locale: 'en',
|
||||
nickname: 'Night Owl',
|
||||
onLocaleChange: () => {},
|
||||
onNicknameChange: () => {},
|
||||
onRestartStack: () => {},
|
||||
t,
|
||||
};
|
||||
|
||||
describe('SettingsPanel', () => {
|
||||
it('renders general nickname and language settings', () => {
|
||||
const html = renderToStaticMarkup(createElement(SettingsPanel, baseProps));
|
||||
|
||||
expect(html).toContain('settings-panel');
|
||||
expect(html).toContain(t.settings.nicknameLabel);
|
||||
expect(html).toContain('value="Night Owl"');
|
||||
expect(html).toContain(t.settings.languageLabel);
|
||||
expect(html).toContain('한국어');
|
||||
expect(html).toContain('English');
|
||||
});
|
||||
|
||||
it('renders model, fast mode, and account controls', () => {
|
||||
const html = renderToStaticMarkup(createElement(SettingsPanel, baseProps));
|
||||
|
||||
expect(html).toContain('모델');
|
||||
expect(html).toContain('패스트 모드');
|
||||
expect(html).toContain('불러오는 중');
|
||||
expect(html).toContain('Claude');
|
||||
expect(html).toContain('계정');
|
||||
expect(html).toContain('전체 갱신');
|
||||
expect(html).toContain('스택 재시작');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user