test(e2e): Alle opgaver-prøven rydder sin gruppe op igen
Den efterlod en projektgruppe på den fælles konto, og to af de andre gruppeprøver regner med, at der kun er deres egen i sidebjælken. Kun gruppen slettes: projekterne i papirkurven gav gendannelsesprøven mere end sin egen at vælge imellem. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2aa56e3b6d
commit
22b79cdfa7
+20
-1
@@ -283,9 +283,19 @@ test('Alle opgaver viser det hele inddelt efter gruppe, prioritet og dato', asyn
|
||||
});
|
||||
const loose = await send('POST', '/projects', { name: `Løst ${stamp}` });
|
||||
await send('POST', '/tasks', { content: `Ring til VVS ${stamp}`, project_id: loose.id });
|
||||
return { group: group.name, project: project.name };
|
||||
return {
|
||||
group: group.name,
|
||||
project: project.name,
|
||||
ids: { group: group.id }
|
||||
};
|
||||
}, stamp);
|
||||
|
||||
// The group is removed again whatever happens below: the suite shares one
|
||||
// account, and a group left in the sidebar breaks the tests that expect one
|
||||
// there. Only the group — deleting the projects as well puts them in the trash,
|
||||
// where the restore test then finds more than its own.
|
||||
try {
|
||||
|
||||
// Through the sidebar, so the entry is tested as well as the page.
|
||||
await page.reload();
|
||||
const sidebar = page.getByRole('navigation', { name: 'Hovedmenu' });
|
||||
@@ -334,6 +344,15 @@ test('Alle opgaver viser det hele inddelt efter gruppe, prioritet og dato', asyn
|
||||
has: page.getByRole('heading', { name: 'Uden dato' })
|
||||
});
|
||||
await expect(noDate.getByText(`Ring til VVS ${stamp}`)).toBeVisible();
|
||||
} finally {
|
||||
await page.evaluate(async (group) => {
|
||||
await fetch(`/api/v1/project-groups/${group}`, {
|
||||
method: 'DELETE',
|
||||
credentials: 'include',
|
||||
headers: { 'Sec-Fetch-Site': 'same-origin' }
|
||||
});
|
||||
}, names.ids.group);
|
||||
}
|
||||
|
||||
expect(trouble).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user