Skip to content

Commit

Permalink
test: b2b user registration e2es fail on upgraded server (#19865)
Browse files Browse the repository at this point in the history
CXSPA-9183
  • Loading branch information
FollowTheFlo authored Jan 20, 2025
1 parent 6264a66 commit 40c9daa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,12 @@ context('B2B - User Registration', () => {
verifyFormErrors();
});

it('should display error global message if user exists (CXSPA-215)', () => {
it('should no throw error if user already exists (CXSPA-215)', () => {
let user = getSampleUser();
user.email = myCompanyAdminUser.registrationData?.email;

fillOrganizationUserRegistrationForm(user);
submitOrganizationUserRegistrationForm();

/*
* CXSPA-9183
* Leave below check commented until cx-server gets upgraded to 2211.32
* tbd after upgrade: POST orgUsers request should expect '201 created' response.
*/

// verifyGlobalMessageAfterRegistration(
// 'User with this e-mail address already exists.'
// );
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,22 @@ export function fillOrganizationUserRegistrationForm(
/**
* Method submits prefiled form and by default waits till registration request will be completed.
*
* @param {boolean} [wiatForRequestCompletion=true]
* @param {boolean} [waitForRequestCompletion=true]
* specifies if cypress should wait till registration request be completed.
*/
export function submitOrganizationUserRegistrationForm(
wiatForRequestCompletion: boolean = true
waitForRequestCompletion: boolean = true
) {
interceptPost('registerOrganizationUser', '*/orgUsers*');

cy.get(form).within(() => {
cy.get('button[type=submit]').click();
});

if (wiatForRequestCompletion) {
cy.wait('@registerOrganizationUser');
if (waitForRequestCompletion) {
cy.wait('@registerOrganizationUser')
.its('response.statusCode')
.should('eq', 201);
}
}

Expand Down

0 comments on commit 40c9daa

Please sign in to comment.