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

refactor: add @openedx in renovate automate configuration #1045

Merged
merged 2 commits into from
Oct 3, 2023
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
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"rebaseStalePrs": true,
"packageRules": [
{
"matchPackagePatterns": ["@edx"],
"matchPackagePatterns": ["@edx", "@openedx"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
3 changes: 1 addition & 2 deletions src/components/learner-credit-management/data/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down