fix(import): readable dropdowns in dark mode, select all and none

This commit is contained in:
lobo committed 2026-09-29 15:10:41 +02:00
1 parent 24a98062ee
commit 111ab1e200
5 files changed
+49 -1

No files matched your search

+26
View File
@@ -171,6 +171,32 @@ describe('ImportPage', () => {
]});
});
it('checks every line with a new match at once, and none', async () => {
renderPage({'GET ': json(200, {imports: []}), 'GET /5': json(200, ready)}, '/import?id=5');
const checked = () => ['Hades', 'Celeste', 'Hade'].map((title) => screen.getByLabelText(`IMPORT.LINE: ${title}`).checked);
await screen.findByLabelText('IMPORT.LINE: Hades');
fireEvent.click(screen.getByRole('button', {name: 'IMPORT.SELECT_ALL'}));
// Celeste is in the library already.
expect(checked()).toEqual([true, false, true]);
expect(screen.getByRole('button', {name: 'IMPORT.SAVE:2'})).toBeTruthy();
fireEvent.click(screen.getByRole('button', {name: 'IMPORT.SELECT_NONE'}));
expect(checked()).toEqual([false, false, false]);
expect(screen.getByRole('button', {name: 'IMPORT.SAVE:0'}).disabled).toBe(true);
});
it('keeps a line in the library that was checked by hand on select all', async () => {
renderPage({'GET ': json(200, {imports: []}), 'GET /5': json(200, ready)}, '/import?id=5');
const celesteBox = await screen.findByLabelText('IMPORT.LINE: Celeste');
fireEvent.click(celesteBox);
expect(celesteBox.checked).toBe(true);
fireEvent.click(screen.getByRole('button', {name: 'IMPORT.SELECT_ALL'}));
expect(screen.getByLabelText('IMPORT.LINE: Celeste').checked).toBe(true);
});
it('undoes a saved import after a confirm with the changed count', async () => {
renderPage({
'GET ': json(200, {imports: [{id: 4, source: 'CSV', status: 'SAVED', total: 3, matched: 3, createdAt: '2026-09-29T10:00:00Z'}]}),