Mediabibliotheek: filter gebruikt/ongebruikt en link van een gebruik naar de module
Continuous Integration / config-sls (pull_request) Successful in 7s
Continuous Integration / changes (pull_request) Successful in 15s
Continuous Integration / config-asf (pull_request) Successful in 8s
Continuous Integration / frontend-prepare (pull_request) Successful in 38s
Continuous Integration / vulnerability-scan (pull_request) Successful in 1m12s
Continuous Integration / frontend-build (pull_request) Successful in 52s
Continuous Integration / backend-build (pull_request) Successful in 1m12s
Continuous Integration / frontend-lint (pull_request) Successful in 39s
Continuous Integration / compile-sites (pull_request) Canceled after 5m28s
Continuous Integration / publish-sls-test (pull_request) Canceled after 0s
Continuous Integration / publish-sls-production (pull_request) Canceled after 0s
Continuous Integration / deploy-sls-test (pull_request) Canceled after 0s
Continuous Integration / deploy-sls-production (pull_request) Canceled after 0s
Continuous Integration / publish-asf-test (pull_request) Canceled after 0s
Continuous Integration / deploy-asf-test (pull_request) Canceled after 0s
Continuous Integration / smoke-sls-test (pull_request) Canceled after 0s
Continuous Integration / smoke-asf-test (pull_request) Canceled after 0s
Continuous Integration / backend-test (pull_request) Canceled after 1m12s
Continuous Integration / frontend-test (pull_request) Canceled after 2m14s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:19:48 +01:00
co-authored by Claude Sonnet 5.5
parent a01bcd33c4
commit 552102de2e
6 changed files with 69 additions and 3 deletions
@@ -177,6 +177,20 @@ describe('MediaLibraryPage', () => {
await waitFor(() => expect(body).toEqual({ ids: ['hero:22222222-2222-2222-2222-222222222222'], confirmedInUse: false }));
});
it('filters the library on used and unused photos and links a use to its module', async () => {
renderWithProviders(<MediaLibraryPage />);
const list = await screen.findByTestId('photo-selection-list');
expect(within(list).getAllByRole('listitem')).toHaveLength(3);
await userEvent.click(screen.getByTestId('filter-unused'));
expect(within(screen.getByTestId('photo-selection-list')).getAllByRole('listitem')).toHaveLength(1);
await userEvent.click(screen.getByTestId('filter-used'));
const used = within(screen.getByTestId('photo-selection-list')).getAllByRole('listitem');
expect(used).toHaveLength(2);
expect(within(used[0]!).getByRole('link', { name: 'Hero, slide 1' })).toHaveAttribute('href', '/hero');
});
it('shows an error when the library cannot be loaded', async () => {
server.use(http.get('*/media-library/photos', () => new HttpResponse(null, { status: 500 })));
renderWithProviders(<MediaLibraryPage />);