Skip to content

Commit

Permalink
fix: make start and end date relative to current date
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed May 3, 2024
1 parent 565b899 commit cef205f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { HttpRequestHook } from '@frontend/shared/browser-tests/http-utils/http-request-hook';
import requestLogger from '@frontend/shared/browser-tests/utils/request-logger';
import { clearDataToPrintOnFailure } from '@frontend/shared/browser-tests/utils/testcafe.utils';
import { convertToUIDateFormat } from '@frontend/shared/src/utils/date.utils';
import { addMonths, subMonths } from 'date-fns';
import { t } from 'testcafe';

import DeMinimisAid from '../page-model/deminimis';
Expand All @@ -25,7 +27,8 @@ fixture('Company')
clearDataToPrintOnFailure(testController);
});

const currentYear = new Date().getFullYear();
const startDate = subMonths(new Date(), 4);
const endDate = addMonths(new Date(), 3);
const form: ApplicationFormData = {
organization: {
iban: '6051437344779954',
Expand All @@ -45,8 +48,8 @@ const form: ApplicationFormData = {
monthlyPay: '2300',
otherExpenses: '300',
vacationMoney: '500',
startDate: `1.1.${currentYear}`,
endDate: `1.2.${currentYear}`,
startDate: convertToUIDateFormat(startDate),
endDate: convertToUIDateFormat(endDate),
},
deMinimisAid: {
granter: 'One',
Expand Down

0 comments on commit cef205f

Please sign in to comment.