Public Access
feat(picker): add the speedrun mood and the speedrun.com link
"What to play next" gets a Speedrun mood. The game detail links the game's speedrun.com page when Core found one with verified runs; only https://www.speedrun.com/ links are shown.
This commit is contained in:
1 parent
b0c78d8dca
commit
23ab5a91e7
7 files changed
+82
-12
No files matched your search
@@ -110,6 +110,30 @@ describe('PlayNextPage', () => {
|
||||
expect(screen.getByText('PLAY_NEXT.MOOD_HINT')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('asks for speedrun games and explains the background check', async () => {
|
||||
mockBackend([[game(1)], []]);
|
||||
renderPage();
|
||||
await screen.findByText('Game 1');
|
||||
|
||||
fireEvent.click(screen.getByRole('button', {name: 'PLAY_NEXT.MOOD.SPEEDRUN'}));
|
||||
|
||||
expect(await screen.findByText('PLAY_NEXT.EMPTY_SPEEDRUN')).toBeTruthy();
|
||||
expect(pickerUrls()[1].get('mood')).toBe('SPEEDRUN');
|
||||
expect(screen.getByText('PLAY_NEXT.MOOD_HINT_SPEEDRUN')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('with a length limit, an empty speedrun pick says to change the length', async () => {
|
||||
mockBackend([[game(1)], [game(2)], []]);
|
||||
renderPage();
|
||||
await screen.findByText('Game 1');
|
||||
fireEvent.click(screen.getByRole('button', {name: 'PLAY_NEXT.BUDGET.SHORT'}));
|
||||
await screen.findByText('Game 2');
|
||||
|
||||
fireEvent.click(screen.getByRole('button', {name: 'PLAY_NEXT.MOOD.SPEEDRUN'}));
|
||||
|
||||
expect(await screen.findByText('PLAY_NEXT.EMPTY_MOOD')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('drops the old picks when a new budget fails to load', async () => {
|
||||
mockBackend([[game(1)]]);
|
||||
const pickerFetch = globalThis.fetch;
|
||||
|
||||
Reference in new issue
Block a user