|
@@ -69,13 +69,15 @@ describe('InviteMissingMembersModal', function () {
|
|
|
).not.toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
- it('disables invite button if no members selected', function () {
|
|
|
+ it('disables invite button if no members selected', async function () {
|
|
|
render(<InviteMissingMembersModal {...modalProps} missingMembers={missingMembers} />);
|
|
|
|
|
|
expect(
|
|
|
screen.getByRole('heading', {name: 'Invite Your Dev Team'})
|
|
|
).toBeInTheDocument();
|
|
|
|
|
|
+ await userEvent.click(screen.getByLabelText('Deselect All'));
|
|
|
+
|
|
|
expect(screen.getByLabelText('Send Invites')).toBeDisabled();
|
|
|
expect(screen.getByText('Invite missing members')).toBeInTheDocument();
|
|
|
});
|
|
@@ -87,6 +89,7 @@ describe('InviteMissingMembersModal', function () {
|
|
|
screen.getByRole('heading', {name: 'Invite Your Dev Team'})
|
|
|
).toBeInTheDocument();
|
|
|
|
|
|
+ await userEvent.click(screen.getByLabelText('Deselect All'));
|
|
|
await userEvent.click(screen.getByLabelText('Select hello@sentry.io'));
|
|
|
|
|
|
expect(screen.getByLabelText('Send Invites')).toBeEnabled();
|
|
@@ -98,22 +101,22 @@ describe('InviteMissingMembersModal', function () {
|
|
|
expect(screen.getByText('Invite missing members')).toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
- it('can select and deselect all rows', async function () {
|
|
|
+ it('can deselect and select all rows', async function () {
|
|
|
render(<InviteMissingMembersModal {...modalProps} missingMembers={missingMembers} />);
|
|
|
|
|
|
expect(
|
|
|
screen.getByRole('heading', {name: 'Invite Your Dev Team'})
|
|
|
).toBeInTheDocument();
|
|
|
|
|
|
- await userEvent.click(screen.getByLabelText('Select All'));
|
|
|
-
|
|
|
- expect(screen.getByLabelText('Send Invites')).toBeEnabled();
|
|
|
- expect(screen.getByText('Invite all 5 missing members')).toBeInTheDocument();
|
|
|
-
|
|
|
await userEvent.click(screen.getByLabelText('Deselect All'));
|
|
|
|
|
|
expect(screen.getByLabelText('Send Invites')).toBeDisabled();
|
|
|
expect(screen.getByText('Invite missing members')).toBeInTheDocument();
|
|
|
+
|
|
|
+ await userEvent.click(screen.getByLabelText('Select All'));
|
|
|
+
|
|
|
+ expect(screen.getByLabelText('Send Invites')).toBeEnabled();
|
|
|
+ expect(screen.getByText('Invite all 5 missing members')).toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
it('can invite all members', async function () {
|
|
@@ -136,7 +139,6 @@ describe('InviteMissingMembersModal', function () {
|
|
|
screen.getByRole('heading', {name: 'Invite Your Dev Team'})
|
|
|
).toBeInTheDocument();
|
|
|
|
|
|
- await userEvent.click(screen.getByLabelText('Select All'));
|
|
|
await userEvent.click(screen.getByLabelText('Send Invites'));
|
|
|
|
|
|
// Verify data sent to the backend
|
|
@@ -173,6 +175,8 @@ describe('InviteMissingMembersModal', function () {
|
|
|
screen.getByRole('heading', {name: 'Invite Your Dev Team'})
|
|
|
).toBeInTheDocument();
|
|
|
|
|
|
+ await userEvent.click(screen.getByLabelText('Deselect All'));
|
|
|
+
|
|
|
const roleInputs = screen.getAllByRole('textbox', {name: 'Role'});
|
|
|
const teamInputs = screen.getAllByRole('textbox', {name: 'Add to Team'});
|
|
|
|