feat(ui): add follow button, follows card, and inbox page
Build, Test & Push Frontend / quality-check (push) Successful in 34s
Build, Test & Push Frontend / docker (push) Successful in 23s

This commit is contained in:
lobo committed 2026-10-06 16:22:22 +02:00
1 parent 3aed243e35
commit 43c4862606
23 files changed
+603 -2

No files matched your search

+19 -1
View File
@@ -18,7 +18,8 @@ afterEach(() => {
const loggedInAs = (me, routes = {}) => {
localStorage.setItem('tbp_session', '1');
fetchRoutes({'GET /api/users/me': json(200, me), 'GET /api/library/steam-profile': json(200, {}), ...routes});
fetchRoutes({'GET /api/users/me': json(200, me), 'GET /api/library/steam-profile': json(200, {}),
'GET /api/inbox': json(200, {results: [], unread: 0}), ...routes});
renderWithProviders(<AppHeader isAuthenticated onLogout={() => {}}/>);
};
@@ -45,6 +46,23 @@ describe('AppHeader', () => {
expect(screen.getByRole('link', {name: 'ToBePlayed'})).toBeTruthy();
});
it('shows how many inbox notes are unread', async () => {
loggedInAs({role: 'USER', activeRole: 'USER'}, {'GET /api/inbox': json(200, {results: [], unread: 3})});
const link = await screen.findByRole('link', {name: 'NAV.INBOX_UNREAD:3'});
expect(link.getAttribute('href')).toBe('/inbox');
expect(link.textContent).toBe('3');
});
it('shows no count without unread notes', async () => {
loggedInAs({role: 'USER', activeRole: 'USER'});
const link = await screen.findByRole('link', {name: 'NAV.INBOX'});
expect(link.textContent).toBe('');
});
it('offers the admin page and "view as" to an admin', async () => {
loggedInAs({role: 'PLATFORM_ADMIN', activeRole: 'PLATFORM_ADMIN'},
{'GET /api/admin/users/pending-count': json(200, {count: 0})});