diff --git a/renovate.json b/renovate.json index b332af838c..8f6a3afef6 100644 --- a/renovate.json +++ b/renovate.json @@ -8,7 +8,7 @@ "rebaseStalePrs": true, "packageRules": [ { - "matchPackagePatterns": ["@edx"], + "matchPackagePatterns": ["@edx", "@openedx"], "matchUpdateTypes": ["minor", "patch"], "automerge": true } diff --git a/src/components/learner-credit-management/data/tests/utils.test.js b/src/components/learner-credit-management/data/tests/utils.test.js index 96061c8af7..ab19a94d27 100644 --- a/src/components/learner-credit-management/data/tests/utils.test.js +++ b/src/components/learner-credit-management/data/tests/utils.test.js @@ -96,14 +96,16 @@ describe('getBudgetStatus', () => { it('should return "upcoming" when the current date is before the start date', () => { const startDateStr = '2023-09-30'; const endDateStr = '2023-10-30'; - const result = getBudgetStatus(startDateStr, endDateStr); + const currentDateStr = '2023-09-28'; + const result = getBudgetStatus(startDateStr, endDateStr, new Date(currentDateStr)); expect(result).toEqual('Upcoming'); }); it('should return "active" when the current date is between the start and end dates', () => { const startDateStr = '2023-09-01'; const endDateStr = '2023-09-30'; - const result = getBudgetStatus(startDateStr, endDateStr); + const currentDateStr = '2023-09-05'; + const result = getBudgetStatus(startDateStr, endDateStr, new Date(currentDateStr)); expect(result).toEqual('Active'); }); diff --git a/src/components/learner-credit-management/data/utils.js b/src/components/learner-credit-management/data/utils.js index 5bd64d257d..c42cb4039c 100644 --- a/src/components/learner-credit-management/data/utils.js +++ b/src/components/learner-credit-management/data/utils.js @@ -113,8 +113,7 @@ export const getProgressBarVariant = ({ percentUtilized, remainingFunds }) => { export const isUUID = (id) => /^[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}$/.test(id); // Utility function to check the budget status -export const getBudgetStatus = (startDateStr, endDateStr) => { - const currentDate = new Date(); +export const getBudgetStatus = (startDateStr, endDateStr, currentDate = new Date()) => { const startDate = new Date(startDateStr); const endDate = new Date(endDateStr);