From 6c43c4899b16eaff133f4b24f5ec25412c4a8fc0 Mon Sep 17 00:00:00 2001 From: Zain Kassam Date: Fri, 31 Jan 2025 11:23:43 +0000 Subject: [PATCH 1/4] fix(DTFS2-7798): remove duplicate createdBy --- .../swagger-definitions/portal/portal-amendments.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/dtfs-central-api/src/v1/swagger-definitions/portal/portal-amendments.js b/dtfs-central-api/src/v1/swagger-definitions/portal/portal-amendments.js index 2d6613d605..2d131a5393 100644 --- a/dtfs-central-api/src/v1/swagger-definitions/portal/portal-amendments.js +++ b/dtfs-central-api/src/v1/swagger-definitions/portal/portal-amendments.js @@ -32,18 +32,6 @@ * - IN_PROGRESS * - COMPLETED * description: The current status of the amendment. - * createdBy: - * type: object - * properties: - * username: - * type: string - * description: The username of the creator. - * name: - * type: string - * description: The name of the creator. - * email: - * type: string - * description: The email of the creator. * eligibilityCriteria: * type: object * properties: From 5921bea9a422961458628e048dbe2790cb7e846e Mon Sep 17 00:00:00 2001 From: Zain Kassam Date: Fri, 31 Jan 2025 16:37:55 +0000 Subject: [PATCH 2/4] fix(DTFS2-7798): fix failing test --- e2e-tests/e2e-fixtures/dateConstants.js | 2 ++ ...nissued-facilities-MIA-and-resubmit-to-ukef.spec.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/e2e-tests/e2e-fixtures/dateConstants.js b/e2e-tests/e2e-fixtures/dateConstants.js index 6a3dd6b7a3..0f20e359a3 100644 --- a/e2e-tests/e2e-fixtures/dateConstants.js +++ b/e2e-tests/e2e-fixtures/dateConstants.js @@ -59,6 +59,8 @@ export const twelveMonthsOneDayAgo = getFormattedValues(sub(todayDate, { months: export const oneYearAgo = getFormattedValues(sub(todayDate, { years: 1 })); export const twoYearsAgo = getFormattedValues(sub(todayDate, { years: 2 })); +export const addDays = (days) => getFormattedValues(add(todayDate, { days })); + // Dates calculated from other values /** * This constant is used for calculating the deadline for issuing a facility with submission date three days ago. diff --git a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-with-issued-and-unissued-facilities-MIA-and-resubmit-to-ukef.spec.js b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-with-issued-and-unissued-facilities-MIA-and-resubmit-to-ukef.spec.js index 9436ea778b..8934e41254 100644 --- a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-with-issued-and-unissued-facilities-MIA-and-resubmit-to-ukef.spec.js +++ b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-with-issued-and-unissued-facilities-MIA-and-resubmit-to-ukef.spec.js @@ -1,7 +1,7 @@ import { PORTAL_ACTIVITY_LABEL } from '@ukef/dtfs2-common'; import relative from '../../relativeURL'; import CONSTANTS from '../../../fixtures/constants'; -import { threeDaysAgo, threeMonthsOneDay, twoMonths, threeMonths } from '../../../../../e2e-fixtures/dateConstants'; +import { threeDaysAgo, addDays, twoMonths, threeMonths } from '../../../../../e2e-fixtures/dateConstants'; import { MOCK_APPLICATION_MIA, MOCK_APPLICATION_MIA_DRAFT, UKEF_DECISION, underwriterManagersDecision } from '../../../fixtures/mocks/mock-deals'; import { BANK1_MAKER1, BANK1_CHECKER1, BANK1_CHECKER1_WITH_MOCK_ID } from '../../../../../e2e-fixtures/portal-users.fixture'; import { anIssuedCashFacilityWithCoverDateConfirmed, multipleMockGefFacilities } from '../../../../../e2e-fixtures/mock-gef-facilities'; @@ -205,7 +205,13 @@ context('Review UKEF decision MIA -> confirm coverStartDate and issue unissued f coverStartDate.coverStartDateNo().click(); - cy.completeDateFormFields({ idPrefix: 'ukef-cover-start-date', date: threeMonthsOneDay.date }); + /** + * 3 months in the future in codebase is calculated as 90 days from today + * hence to get date over 3 months in the future to cause an error to be displayed + * add 91 days to today + */ + const days = 91; + cy.completeDateFormFields({ idPrefix: 'ukef-cover-start-date', date: addDays(days).date }); cy.clickContinueButton(); From c4ba4b08c4e525755b45abb07c777d1c75caa17b Mon Sep 17 00:00:00 2001 From: zainZzKk <51957827+Zainzzkk@users.noreply.github.com> Date: Fri, 31 Jan 2025 22:06:09 +0000 Subject: [PATCH 3/4] fix(DTFS2-7798): fixed failing test --- ...ut-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js index 33637c1489..c8244e48d1 100644 --- a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js +++ b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js @@ -190,7 +190,13 @@ context('Review UKEF decision MIA -> confirm coverStartDate without issuing faci coverStartDate.coverStartDateNo().click(); - cy.completeDateFormFields({ idPrefix: 'ukef-cover-start-date', date: threeMonthsOneDay.date }); + /** + * 3 months in the future in codebase is calculated as 90 days from today + * hence to get date over 3 months in the future to cause an error to be displayed + * add 91 days to today + */ + const days = 91; + cy.completeDateFormFields({ idPrefix: 'ukef-cover-start-date', date: addDays(days).date }); cy.clickContinueButton(); From 47caf6adcfad97735dab79fc16eb8693886c7a07 Mon Sep 17 00:00:00 2001 From: zainZzKk <51957827+Zainzzkk@users.noreply.github.com> Date: Fri, 31 Jan 2025 22:12:41 +0000 Subject: [PATCH 4/4] fix(DTFS2-7798): fixed linting issue --- ...-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js index c8244e48d1..2f1aeca172 100644 --- a/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js +++ b/e2e-tests/gef/cypress/e2e/facility/review-ukef-approval/review-ukef-approval-without-issuing-facilities-MIA-and-resubmit-to-ukef.spec.js @@ -1,7 +1,7 @@ import { PORTAL_ACTIVITY_LABEL } from '@ukef/dtfs2-common'; import relative from '../../relativeURL'; import CONSTANTS from '../../../fixtures/constants'; -import { tomorrow, threeDaysAgo, threeMonthsOneDay } from '../../../../../e2e-fixtures/dateConstants'; +import { tomorrow, threeDaysAgo, addDays } from '../../../../../e2e-fixtures/dateConstants'; import { MOCK_APPLICATION_MIA, MOCK_APPLICATION_MIA_DRAFT, UKEF_DECISION, underwriterManagersDecision } from '../../../fixtures/mocks/mock-deals'; import { BANK1_MAKER1, BANK1_CHECKER1, BANK1_CHECKER1_WITH_MOCK_ID } from '../../../../../e2e-fixtures/portal-users.fixture'; import { anIssuedCashFacilityWithCoverDateConfirmed, multipleMockGefFacilities } from '../../../../../e2e-fixtures/mock-gef-facilities';