Skip to content

Commit

Permalink
CORE-676 e2e/s7 fix form error
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-xbo committed Jun 1, 2021
1 parent c5a16b6 commit 881e0a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ describe('S7 - Status wechselt korrekt', () => {
cy.intercept('GET', '**/hd/cases').as('getAllCases');
cy.intercept('POST', '**/hd/cases/?type=index').as('newIndex');
cy.intercept('PUT', '/enrollment/questionnaire').as('updateQuestionnaire');
cy.intercept('GET', '/enrollment').as('getQuestionnaire');
cy.intercept({
method: 'GET',
url: /.*\/hd\/cases\/[0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12}\/registration$/,
}).as('getEmailText');
cy.intercept({
method: 'GET',
url: /.*\/hd\/cases\/[0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12}\/registration$/,
Expand Down Expand Up @@ -230,12 +235,20 @@ describe('S7 - Status wechselt korrekt', () => {
/* 39 - wähle "Kontakt anlegen" in Popup */
cy.get('[data-cy="confirm-button"]').click();

/* CHECK */
cy.get('[data-cy="contact-person-form-first-name"]').should('exist').clear();
cy.get('[data-cy="contact-person-form-last-name"]').should('exist').clear();
cy.get('[data-cy="contact-person-form-first-name"]').type('Carl');
cy.get('[data-cy="contact-person-form-last-name"]').type('Benz');

/* 40 - Telefonnummer (mobil) -> "017196347526" */
cy.get('[data-cy="contact-person-form-mobile-phone"]').type('017196347526');

/* 41 - Klick auf "speichern" */
cy.get('[data-cy="submit-button"]').click();

cy.wait('@getQuestionnaire').its('response.statusCode').should('eq', 200);

/* 42 - Klick auf "Erfassung abschließen" */
cy.get('[data-cy="third-step-button"]').click();

Expand Down Expand Up @@ -272,7 +285,7 @@ describe('S7 - Status wechselt korrekt', () => {

/* 47 - Popup "Diesen Fall abschließen" geht auf */
/* 48 - Zusätzliche Informationen zum Fallabschluss: -> "Quarantäne beendet" */
cy.get('[data-cy="comment-textarea"]').type('Quarantäne beendet');
cy.get('[data-cy="comment-textarea"]').should('exist').type('Quarantäne beendet');

/* 49 - Klicke "OK" */
cy.get('[data-cy="confirm-button"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
type="text"
#first_name_input
(blur)="trimValue(first_name_input)"
data-cy="contact-person-form-first-name"
/>
<mat-error *ngFor="let error of validationErrorService.getErrorKeys(formGroup.controls.firstName)">
{{ validationErrorService.getErrorMessage(formGroup.controls.firstName, error) | async }}
Expand All @@ -31,6 +32,7 @@
type="text"
#last_name_input
(blur)="trimValue(first_name_input)"
data-cy="contact-person-form-last-name"
/>
<mat-error *ngFor="let error of validationErrorService.getErrorKeys(formGroup.controls.lastName)">
{{ validationErrorService.getErrorMessage(formGroup.controls.lastName, error) | async }}
Expand All @@ -53,7 +55,7 @@
{{ validationErrorService.getErrorMessage(formGroup.controls.phone, error) | async }}
</mat-error>
</mat-form-field>
<mat-form-field class="full-width" data-cy="contact-person-form-mobile-phone">
<mat-form-field class="full-width" data-cy="contact-person-form-mobile-phone2">
<input
data-cy="input-mobilePhone"
matInput
Expand All @@ -64,6 +66,7 @@
type="phone"
#mobile_phone_input
(blur)="trimValue(mobile_phone_input)"
data-cy="contact-person-form-mobile-phone"
/>
<mat-error *ngFor="let error of validationErrorService.getErrorKeys(formGroup.controls.mobilePhone)">
{{ validationErrorService.getErrorMessage(formGroup.controls.mobilePhone, error) | async }}
Expand Down

0 comments on commit 881e0a5

Please sign in to comment.