feat(games): add coming badge for unreleased games
Build, Test & Push Frontend / quality-check (push) Successful in 32s
Build, Test & Push Frontend / docker (push) Successful in 22s

This commit is contained in:
lobo committed 2026-10-05 20:33:25 +02:00
1 parent edeea5a43d
commit c158909083
17 files changed
+169 -3

No files matched your search

+13
View File
@@ -34,6 +34,19 @@ const renderPage = (name = 'Lobo') => renderWithProviders(<PublicProfilePage/>,
describe('PublicProfilePage', () => {
afterEach(cleanup);
it('shows the coming badge on a game that is not released yet, in both lists', async () => {
mockBackends({answer: {...library,
playing: [{...library.playing[0], status: 'PLAYING', coming: true, comingOn: '2026-12-04'}],
finished: [{...library.finished[0], coming: false, comingOn: null}]}});
renderPage();
await screen.findByText('Portal 2');
expect(screen.getAllByText('LIBRARY.COMING')).toHaveLength(1);
expect(screen.getByText('Half-Life 2').closest('li').textContent).toContain('LIBRARY.COMING');
expect(screen.getByText('Portal 2').closest('li').textContent).not.toContain('LIBRARY.COMING');
});
it('wears the premium accent and the badge of the owner', async () => {
mockBackends({style: {accent: 'red'}, equipped: {ACCENT: 'ACCENT_GOLD', BADGE: 'BADGE_PILE_SLAYER', BANNER_FRAME: 'FRAME_GOLD'}});
renderPage();