Refactor invitations.spec.ts for consistency
Altered import order and formatting in the invitations.spec.ts file. Additionally, the text used for member-role-badge assertion tests has been capitalized to match the correct output. All changes were made to improve code readability and testing accuracy.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { expect, Page, test } from '@playwright/test';
|
import { Page, expect, test } from '@playwright/test';
|
||||||
|
|
||||||
import { InvitationsPageObject } from './invitations.po';
|
import { InvitationsPageObject } from './invitations.po';
|
||||||
|
|
||||||
test.describe('Invitations', () => {
|
test.describe('Invitations', () => {
|
||||||
@@ -21,7 +22,7 @@ test.describe('Invitations', () => {
|
|||||||
const invites = [
|
const invites = [
|
||||||
{
|
{
|
||||||
email,
|
email,
|
||||||
role: 'member'
|
role: 'member',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ test.describe('Invitations', () => {
|
|||||||
const invites = [
|
const invites = [
|
||||||
{
|
{
|
||||||
email,
|
email,
|
||||||
role: 'member'
|
role: 'member',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -55,7 +56,9 @@ test.describe('Invitations', () => {
|
|||||||
|
|
||||||
const row = invitations.getInvitationRow(email);
|
const row = invitations.getInvitationRow(email);
|
||||||
|
|
||||||
await expect(row.locator('[data-test="member-role-badge"]')).toHaveText('owner');
|
await expect(row.locator('[data-test="member-role-badge"]')).toHaveText(
|
||||||
|
'Owner',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -77,11 +80,11 @@ test.describe('Full Invitation Flow', () => {
|
|||||||
const invites = [
|
const invites = [
|
||||||
{
|
{
|
||||||
email: invitations.auth.createRandomEmail(),
|
email: invitations.auth.createRandomEmail(),
|
||||||
role: 'member'
|
role: 'member',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
email: invitations.auth.createRandomEmail(),
|
email: invitations.auth.createRandomEmail(),
|
||||||
role: 'member'
|
role: 'member',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -89,7 +92,7 @@ test.describe('Full Invitation Flow', () => {
|
|||||||
|
|
||||||
const firstEmail = invites[0]!.email;
|
const firstEmail = invites[0]!.email;
|
||||||
|
|
||||||
await expect(await invitations.getInvitations()).toHaveCount(2)
|
await expect(await invitations.getInvitations()).toHaveCount(2);
|
||||||
|
|
||||||
// sign out and sign in with the first email
|
// sign out and sign in with the first email
|
||||||
await invitations.auth.signOut();
|
await invitations.auth.signOut();
|
||||||
@@ -101,7 +104,7 @@ test.describe('Full Invitation Flow', () => {
|
|||||||
await invitations.auth.signUp({
|
await invitations.auth.signUp({
|
||||||
email: firstEmail,
|
email: firstEmail,
|
||||||
password: 'password',
|
password: 'password',
|
||||||
repeatPassword: 'password'
|
repeatPassword: 'password',
|
||||||
});
|
});
|
||||||
|
|
||||||
await invitations.auth.visitConfirmEmailLink(firstEmail);
|
await invitations.auth.visitConfirmEmailLink(firstEmail);
|
||||||
|
|||||||
Reference in New Issue
Block a user