feat(ui): add people lists for game owners and community stats
Build, Test & Push Frontend / quality-check (push) Successful in 47s
Build, Test & Push Frontend / docker (push) Successful in 22s

This commit is contained in:
lobo committed 2026-10-06 13:19:58 +02:00
1 parent b213b067dc
commit 3aed243e35
22 files changed
+425 -12

No files matched your search

+22
View File
@@ -31,6 +31,7 @@ const authRoutes = (me) => ({
'PUT /api/users/settings/appearance': noBody,
'PUT /api/users/settings/profile-style': noBody,
'PUT /api/users/settings/favorite-platform': noBody,
'PUT /api/users/settings/owner-lists': noBody,
'GET /api/version': json(404, {}),
});
@@ -65,6 +66,27 @@ describe('SettingsPage public profile', () => {
localStorage.clear();
});
it('disablesTheOwnerListSwitchWhileTheProfileIsPrivate', async () => {
renderPage(profile({settings: {useDarkTheme: true, language: 'de', publicProfile: false, showInOwnerLists: true}}));
const toggle = await screen.findByRole('switch', {name: 'SETTINGS.OWNER_LISTS'});
expect(toggle.disabled).toBe(true);
expect(toggle.getAttribute('aria-checked')).toBe('false');
});
it('savesTheOwnerListSwitchThroughItsOwnEndpoint', async () => {
renderPage(profile());
fireEvent.click(await screen.findByRole('switch', {name: 'SETTINGS.OWNER_LISTS'}));
await waitFor(() => expect(screen.getByRole('switch', {name: 'SETTINGS.OWNER_LISTS'}).getAttribute('aria-checked')).toBe('true'));
const call = fetch.mock.calls.find(([url]) => url.endsWith('/settings/owner-lists'));
expect(call[1].method).toBe('PUT');
expect(JSON.parse(call[1].body)).toEqual({enabled: true});
expect(puts().filter((body) => 'useDarkTheme' in body)).toHaveLength(0);
});
it('keeps the public profile when another setting is saved', async () => {
renderPage(profile());