Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update invite to project test to work with new 'invite' checkbox #994

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ pnpm run build
You can preview the production build with `pnpm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

#### Testing

To run an end-to-end test in the frontend folder:

```bash
pnpm test
```
7 changes: 6 additions & 1 deletion frontend/tests/components/addMemberModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { BaseComponent } from './baseComponent';

const EMAIL_LABEL = 'Email';
const ROLE_LABEL = 'Role';
const SUBMIT_BUTTON_LABEL = new RegExp(`(Add Member)|(Add or invite Member)`);
const INVITE_LABEL = 'Invite';
const SUBMIT_BUTTON_LABEL = new RegExp(`Add Member|Add or invite Member`);

export class AddMemberModal extends BaseComponent {
get emailField(): Locator {
Expand All @@ -14,6 +15,10 @@ export class AddMemberModal extends BaseComponent {
return this.componentLocator.getByLabel(ROLE_LABEL, {exact: true});
}

get inviteCheckbox(): Locator {
return this.componentLocator.getByRole('checkbox', {name: INVITE_LABEL});
}

get submitButton(): Locator {
return this.componentLocator.getByRole('button', {name: SUBMIT_BUTTON_LABEL});
}
Expand Down
1 change: 1 addition & 0 deletions frontend/tests/emailWorkflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ test('register via new-user invitation email', async ({ page }) => {
const addMemberModal = await projectPage.clickAddMember();
await addMemberModal.emailField.fill(newEmail);
await addMemberModal.selectEditorRole();
await addMemberModal.inviteCheckbox.check();
await addMemberModal.submitButton.click();
await page.locator(':text("has been sent an invitation email")').waitFor();

Expand Down