Skip to content

Commit

Permalink
fix code review comments
Browse files Browse the repository at this point in the history
fix code review comments
  • Loading branch information
Melody-zhou-512 committed Jan 15, 2025
1 parent 8f10c35 commit 2ba85c7
Showing 1 changed file with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import * as login from '../../../helpers/login';
import { viewportContext } from '../../../helpers/viewport-context';
import { user } from '../../../sample-data/checkout-flow';

// export function listenForCreateRegistrationVerificationToken(): string {
// return interceptPost(
// 'createVerificationToken',
// '/users/anonymous/verificationToken?*'
// );
// }

export function listenForUserRegistrationVerficationCodeEmailReceive(
customerEmail: string
) {
Expand All @@ -37,14 +30,12 @@ export function listenForUserRegistrationVerficationCodeEmailReceive(

describe('OTP Registration', () => {
viewportContext(['mobile'], () => {
describe('Create OTP For B2C Customer Registration', () => {
describe('B2C Customer Registration With OTP', () => {
beforeEach(() => {
cy.visit('/login/register');
});

it('should be able to create b2c customer with otp (CXSPA-3919)', () => {
// listenForCreateRegistrationVerificationToken();

cy.log(`create verification token from the register form`);
cy.get('cx-otp-register-form form').within(() => {
cy.get('ng-select[formcontrolname="titleCode"]')
Expand All @@ -59,10 +50,6 @@ describe('OTP Registration', () => {
cy.get('button[type=submit]').click();
});

// cy.wait('@createVerificationToken')
// .its('response.statusCode')
// .should('eq', 201);

cy.get('cx-registration-verification-token-form').should('exist');
cy.get('cx-registration-verification-token-form').should('be.visible');

Expand Down Expand Up @@ -113,8 +100,6 @@ describe('OTP Registration', () => {
});
});
it('should not be able to register customer with invalid verification code (CXSPA-3919)', () => {
// listenForCreateRegistrationVerificationToken();

cy.log(`create verification token from the register form`);
cy.get('cx-otp-register-form form').within(() => {
cy.get('ng-select[formcontrolname="titleCode"]')
Expand All @@ -129,9 +114,6 @@ describe('OTP Registration', () => {
cy.get('button[type=submit]').click();
});

// cy.wait('@createVerificationToken')
// .its('response.statusCode')
// .should('eq', 201);
const verificationCode = 'invalidCode';

cy.get('cx-registration-verification-token-form').should('exist');
Expand All @@ -148,7 +130,7 @@ describe('OTP Registration', () => {
});
cy.get('cx-form-errors')
.should('be.visible')
.and('contain.text', 'This code is not invalid');
.and('contain.text', 'This code is not valid');
});
});

Expand Down

0 comments on commit 2ba85c7

Please sign in to comment.