Public Access
feat(library): add game links, auditor queue, audit log and filter
LinkGameDialog (user request or auditor link), EditionsCard on the details page, LinkQueuePage and AuditLogPage for auditors with paging, hideDuplicates filter and editions badge in the library, audit menu entries, de/en texts.
This commit is contained in:
1 parent
80259cb0e9
commit
f71e8f7aff
21 files changed
+992
-11
No files matched your search
@@ -322,6 +322,26 @@ describe('GameDetail of a game added by hand', () => {
|
||||
expect(await screen.findByText('MERGE.TITLE')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('showsTheOtherEditionsAndOffersUnlinkOnlyToAnAuditorOnALinkedGame', async () => {
|
||||
const linked = {...game, linked: true, editions: [{appid: -7, name: 'Half-Life 2 PS5', platform: 'PS5', source: 'MANUAL', status: 'FINISHED'}]};
|
||||
answer(linked, {'DELETE /api/library/games/220/link': json(204)}, {role: 'AUDITOR', activeRole: 'AUDITOR'});
|
||||
renderDetail();
|
||||
|
||||
expect(await screen.findByRole('link', {name: 'Half-Life 2 PS5'})).toBeTruthy();
|
||||
fireEvent.click(await screen.findByRole('button', {name: 'LINKS.UNLINK'}));
|
||||
|
||||
await waitFor(() => expect(fetch.mock.calls.some(([, init]) => init?.method === 'DELETE')).toBe(true));
|
||||
expect(toast.success).toHaveBeenCalledWith('LINKS.UNLINKED');
|
||||
});
|
||||
|
||||
it('offersNoUnlinkWithoutALink', async () => {
|
||||
loggedInAs({role: 'AUDITOR', activeRole: 'AUDITOR'});
|
||||
renderDetail();
|
||||
|
||||
await screen.findByRole('button', {name: 'LINKS.LINK_WITH'});
|
||||
expect(screen.queryByRole('button', {name: 'LINKS.UNLINK'})).toBeNull();
|
||||
});
|
||||
|
||||
it('offers nothing to a user or to an admin viewing as user', async () => {
|
||||
for (const me of [{role: 'USER', activeRole: 'USER'}, {role: 'PLATFORM_ADMIN', activeRole: 'USER'}]) {
|
||||
loggedInAs(me);
|
||||
@@ -333,12 +353,24 @@ describe('GameDetail of a game added by hand', () => {
|
||||
await act(async () => {});
|
||||
expect(screen.queryByRole('button', {name: 'CORRECTION.OPEN'})).toBeNull();
|
||||
expect(screen.queryByRole('button', {name: 'MERGE.OPEN'})).toBeNull();
|
||||
expect(screen.queryByRole('button', {name: 'LINKS.UNLINK'})).toBeNull();
|
||||
cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('GameDetail edition requests', () => {
|
||||
it('opensTheSameGameDialogForAUser', async () => {
|
||||
answer(game, {}, {role: 'USER', activeRole: 'USER'});
|
||||
renderDetail();
|
||||
|
||||
fireEvent.click(await screen.findByRole('button', {name: 'LINKS.SAME_AS'}));
|
||||
|
||||
expect(await screen.findByText('LINKS.DIALOG_HINT')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('GameDetail confetti', () => {
|
||||
// jsdom has no canvas drawing.
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in new issue
Block a user