Expired links (#94)

1. Handle expired links on signup
2.Reject invitations when user is already a member
3. Make sure not to display errors due to Next.js redirection during team creation
4. Fix documentation sidebar
This commit is contained in:
Giancarlo Buomprisco
2024-12-12 12:26:50 +01:00
committed by GitHub
parent ae9c33aea4
commit 97d2cf9f85
11 changed files with 268 additions and 71 deletions

View File

@@ -57,11 +57,15 @@ export class InvitationsPageObject {
}
navigateToMembers() {
return this.page
.locator('a', {
hasText: 'Members',
})
.click();
return expect(async () => {
await this.page
.locator('a', {
hasText: 'Members',
})
.click();
return expect(this.page.url()).toContain('members');
}).toPass()
}
async openInviteForm() {

View File

@@ -60,6 +60,31 @@ test.describe('Invitations', () => {
'Owner',
);
});
test('user cannot invite a member of the team again', async ({ page }) => {
await invitations.navigateToMembers();
const email = invitations.auth.createRandomEmail();
const invites = [
{
email,
role: 'member',
},
];
await invitations.openInviteForm();
await invitations.inviteMembers(invites);
await expect(invitations.getInvitations()).toHaveCount(1);
// Try to invite the same member again
// This should fail
await invitations.openInviteForm();
await invitations.inviteMembers(invites);
await page.waitForTimeout(500);
await expect(invitations.getInvitations()).toHaveCount(1);
});
});
test.describe('Full Invitation Flow', () => {