Skip to content

Commit

Permalink
feat(EMS-3342): no pdf - application submission - XLSX - policy (#2546)
Browse files Browse the repository at this point in the history
* feat(EMS-3342): no pdf - application submission - xlsx - policy fields

* feat(EMS-3342): improve unit test coverage

* feat(EMS-3342): populated application helper improvements

* feat(EMS-3342): no pdf - application submission - xlsx - loss payee location

* feat(EMS-3342): revert commented code

* feat(EMS-3342): fix linting issues

* feat(EMS-3342): fix mock unit test data

* feat(EMS-3342): fix typos

* feat(EMS-3342): fix/update unit test

* feat(EMS-3342): fix/update policy date mapping issue

* chore(merge): fix linting issues

* feat(EMS-3342): fix/update policy date mapping issue

* feat(EMS-3342): fix linting/sonarcloud issues

* feat(EMS-3342): fix/update e2e tests
  • Loading branch information
ttbarnes authored Jun 10, 2024
1 parent 87f3a4f commit 05e8120
Show file tree
Hide file tree
Showing 54 changed files with 1,885 additions and 454 deletions.
27 changes: 20 additions & 7 deletions e2e-tests/commands/insurance/date-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import partials from '../../partials';
* 9) withTwoDateFields.cannotBeAfter
* @param {Number} errorSummaryLength: The number of expected errors in the summary list
* @param {Number} errorIndex: Index of summary list error
* @param {String} fieldId: Field ID
* @param {String} field: Cypress field selector
* @param {Object} errorMessages: Error messages
*/
const checkValidation = ({
Expand All @@ -37,8 +37,14 @@ const checkValidation = ({
* Check validation errors.
*/
notProvided: () => {
cy.keyboardInput(field.monthInput(), '1');
cy.keyboardInput(field.yearInput(), '2023');
const date = new Date();
const month = date.getMonth() + 1;
const year = date.getFullYear();

field.dayInput().clear();
cy.keyboardInput(field.monthInput(), month);
cy.keyboardInput(field.yearInput(), year);

cy.clickSubmitButton();

const errorMessage = errorMessages.INVALID_DAY;
Expand Down Expand Up @@ -287,9 +293,13 @@ const checkValidation = ({

cy.clickSubmitButton();

partials.errorSummaryListItems().eq(0).invoke('text').then((text) => {
expect(text.trim()).not.equal(errorMessages.BEFORE_EARLIEST);
});
partials
.errorSummaryListItems()
.eq(0)
.invoke('text')
.then((text) => {
expect(text.trim()).not.equal(errorMessages.BEFORE_EARLIEST);
});

field.errorMessage().should('not.exist');
},
Expand All @@ -298,7 +308,10 @@ const checkValidation = ({
* E.g, start and end date fields.
*/
withTwoDateFields: ({
fieldA, fieldB, expectedErrorSummaryLength, fieldBErrorIndex,
fieldA,
fieldB,
expectedErrorSummaryLength,
fieldBErrorIndex,
}) => ({
/**
* Enter the same date into both date fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { radios } from '../../../pages/shared';
import { INSURANCE_FIELD_IDS } from '../../../constants/field-ids/insurance';
import { checkAutocompleteInput } from '../../../shared-test-assertions/autocomplete-assertions';
import {
EUR, GBP, JPY, USD,
EUR,
GBP,
JPY,
USD,
} from '../../../fixtures/currencies';

const {
Expand Down
Loading

0 comments on commit 05e8120

Please sign in to comment.