feat(ui): establish Settings page layout primitives
This commit is contained in:
@@ -25,7 +25,7 @@ jest.mock('./components/BackupCard', () => () => <div>Backup Stub</div>);
|
||||
|
||||
const mockedApi = api as jest.Mocked<typeof api>;
|
||||
|
||||
function renderView() {
|
||||
function renderView(overrides: Partial<React.ComponentProps<typeof SettingsView>> = {}) {
|
||||
return render(
|
||||
<MemoryRouter>
|
||||
<ToastProvider>
|
||||
@@ -37,6 +37,7 @@ function renderView() {
|
||||
onColumnsChange={jest.fn()}
|
||||
themeMode="dark"
|
||||
onThemeModeChange={jest.fn()}
|
||||
{...overrides}
|
||||
/>
|
||||
</I18nProvider>
|
||||
</ToastProvider>
|
||||
@@ -163,3 +164,20 @@ test('[PRES-S03 PRES-W11] saving one follow-up rule preserves the other scenario
|
||||
offerFollowUpDays: 7, offerGhostDays: 14, feedbackFollowUpDays: 7, feedbackGhostDays: 14,
|
||||
}));
|
||||
});
|
||||
|
||||
test('[PRES-S03 PRES-J05] table and theme preferences keep their independent callbacks', async () => {
|
||||
const onPageSizeChange = jest.fn();
|
||||
const onColumnsChange = jest.fn();
|
||||
const onThemeModeChange = jest.fn();
|
||||
renderView({ onPageSizeChange, onColumnsChange, onThemeModeChange });
|
||||
await screen.findByText(/AI privacy/i);
|
||||
fireEvent.mouseDown(screen.getByRole('combobox', { name: 'Rows per page' }));
|
||||
fireEvent.click(screen.getByRole('option', { name: '25' }));
|
||||
expect(onPageSizeChange).toHaveBeenCalledWith(25);
|
||||
fireEvent.click(screen.getByRole('checkbox', { name: 'Job URL' }));
|
||||
expect(onColumnsChange).toHaveBeenCalledWith({ status: true, dateApplied: true, daysSince: true, jobUrl: true });
|
||||
fireEvent.mouseDown(screen.getByRole('combobox', { name: 'Theme' }));
|
||||
fireEvent.click(screen.getByRole('option', { name: 'Light' }));
|
||||
expect(onThemeModeChange).toHaveBeenCalledWith('light');
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user