Site-instellingen: ook Beheerder mag lezen en wijzigen

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 14:36:09 +01:00
co-authored by Claude Sonnet 5.5
parent 3535d14987
commit cd81723bf5
5 changed files with 21 additions and 10 deletions
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
import { http, HttpResponse } from 'msw';
import { renderApp, mockAuthenticated, mockGuest } from '@/test/utils';
import { server } from '@/mocks/server';
import { API_BASE } from '@/features/auth/mocks/fixtures';
import { API_BASE, makeAuthResponse, mockUser } from '@/features/auth/mocks/fixtures';
import { _resetSetupStatusCache } from '@/router';
beforeEach(() => {
@@ -19,6 +19,19 @@ describe('SettingsPage', () => {
expect(await screen.findByTestId('settings-title', {}, { timeout: 10000 })).toBeInTheDocument();
});
it('lets an Administrator open the site settings', async () => {
server.use(
http.post(`${API_BASE}/api/v1/auth/refresh`, () =>
HttpResponse.json(
makeAuthResponse({ user: { ...mockUser, role: 'Administrator', name: 'Test Admin' } }),
),
),
);
renderApp('/settings');
expect(await screen.findByTestId('settings-title', {}, { timeout: 10000 })).toBeInTheDocument();
});
it('shows the current availability status badge', async () => {
mockAuthenticated();
renderApp('/settings');