Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ramsons OKAPI Thunderjet tests #4682

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ describe('ui-finance: Fiscal Year Rollover', () => {
thirdFiscalYear.code,
'None',
'Transfer',
'Initial encumbrance'
);
Ledgers.closeRolloverInfo();
Ledgers.selectFundInLedger(defaultFund.name);
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/fragments/finance/funds/funds.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const unreleaseEncumbranceModal = Modal('Unrelease encumbrance');

export default {
defaultUiFund: {
name: `autotest_fund_${getRandomPostfix()}`,
name: `a_autotest_fund_${getRandomPostfix()}`,
code: getRandomPostfix(),
externalAccountNo: getRandomPostfix(),
fundStatus: 'Active',
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/fragments/finance/ledgers/ledgers.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export default {
rolloverBudgetVelueSelect.choose(rolloverBudgetValue),
addAvailableToSelect.choose(rolloverValueAs),
Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(),
Select({ name: 'encumbrancesRollover[0].basedOn' }).choose(basedOn),
Select({ id: 'encumbrancesRollover[0].basedOn' }).choose(basedOn),
]);
cy.get('button:contains("Rollover")').eq(2).should('be.visible').trigger('click');
cy.wait(4000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const getDefaultLocation = ({
campusName: campus.name,
libraryId: library.id,
libraryName: library.name,
name: `autotest_location_name_${getRandomPostfix()}`,
name: `a_autotest_location_name_${getRandomPostfix()}`,
code: `autotest_location_code_${getRandomPostfix()}`,
discoveryDisplayName: `autotest_name_${getRandomPostfix()}`,
// servicePointIds must have real Servi point id
Expand Down
28 changes: 10 additions & 18 deletions cypress/support/utils/dateTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ export default {

getCurrentDateForFiscalYearOnUIEdit: () => {
const currentDate = new Date();
return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(
currentDate.getDate(),
)}/${currentDate.getFullYear()}`;
return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(currentDate.getDate())}/${currentDate.getFullYear()}`;
},

getCurrentDateInPreviusMonthForFiscalYearOnUIEdit: () => {
const currentDate = new Date();
return `${padWithZero(currentDate.getMonth())}/${padWithZero(
currentDate.getDate(),
)}/${currentDate.getFullYear()}`;
currentDate.setMonth(currentDate.getMonth() - 1);
return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(currentDate.getDate())}/${currentDate.getFullYear()}`;
},

getRandomFiscalYearCodeForRollover: (min, max) => {
Expand Down Expand Up @@ -113,9 +110,7 @@ export default {
get2DaysAfterTomorrowDateForFiscalYearOnUIEdit: () => {
const currentDate = new Date();
currentDate.setDate(currentDate.getDate() + 3);
return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(
currentDate.getDate(),
)}/${currentDate.getFullYear()}`;
return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(currentDate.getDate())}/${currentDate.getFullYear()}`;
},

getSomeDaysAfterTomorrowDateForFiscalYear: (days) => {
Expand Down Expand Up @@ -151,15 +146,12 @@ export default {

getPreviousDayDateForFiscalYearOnUIEdit: () => {
const currentDate = new Date();
let day = currentDate.getDate() - 1;
let month = currentDate.getMonth() + 1;
let year = currentDate.getFullYear();
if (day <= 0) {
const lastMonth = new Date(year, month - 2, 1);
year = lastMonth.getFullYear();
month = lastMonth.getMonth() + 1;
day = lastMonth.getDate() + day;
}
currentDate.setDate(currentDate.getDate() - 1);

const day = currentDate.getDate();
const month = currentDate.getMonth() + 1;
const year = currentDate.getFullYear();

return `${padWithZeroDay(month)}/${padWithZeroDay(day)}/${year}`;
},

Expand Down
Loading