mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
handle schedule end date for galas
This commit is contained in:
@@ -3,33 +3,66 @@ import {
|
||||
expectValidTranslationString,
|
||||
} from '../helpers/content.helper'; */
|
||||
// eslint-disable-next-line max-len
|
||||
// import { assembleScheduledMatchers } from '../../website/common/script/content/constants/schedule';
|
||||
import { getAllScheduleMatchingGroups } from '../../website/common/script/content/constants/schedule';
|
||||
|
||||
function validateMatcher(matcher, checkedDate) {
|
||||
expect(matcher.end).to.be.a('date');
|
||||
expect(matcher.end).to.be.greaterThan(checkedDate);
|
||||
}
|
||||
|
||||
describe('Content Schedule', () => {
|
||||
it('assembles scheduled items on january 15th', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-01-15'));
|
||||
const date = new Date('2024-01-15');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on january 31th', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-01-31'));
|
||||
const date = new Date('2024-01-31')
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on march 2nd', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-03-02'));
|
||||
const date = new Date('2024-03-02');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on march 21st', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-03-21'));
|
||||
const date = new Date('2024-03-21');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on october 7th', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-10-07'));
|
||||
const date = new Date('2024-10-07')
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
it('assembles scheduled items on november 1th', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-11-01'));
|
||||
const date = new Date('2024-11-01');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on december 20th', () => {
|
||||
// const items = assembleScheduledMatchers(new Date('2024-12-20'));
|
||||
const date = new Date('2024-12-20');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user