Fix linting issues

This commit is contained in:
Phillip Thelen
2024-04-26 13:15:30 +02:00
parent fbdaa50fcf
commit 99a7b90247
14 changed files with 65 additions and 42 deletions

View File

@@ -5,7 +5,7 @@ import {
// eslint-disable-next-line max-len
import { getAllScheduleMatchingGroups } from '../../website/common/script/content/constants/schedule';
function validateMatcher(matcher, checkedDate) {
function validateMatcher (matcher, checkedDate) {
expect(matcher.end).to.be.a('date');
expect(matcher.end).to.be.greaterThan(checkedDate);
}
@@ -15,15 +15,19 @@ describe('Content Schedule', () => {
const date = new Date('2024-01-15');
const matchers = getAllScheduleMatchingGroups(date);
for (const key in matchers) {
validateMatcher(matchers[key], date);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
it('assembles scheduled items on january 31th', () => {
const date = 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);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
@@ -31,7 +35,9 @@ describe('Content Schedule', () => {
const date = new Date('2024-03-02');
const matchers = getAllScheduleMatchingGroups(date);
for (const key in matchers) {
validateMatcher(matchers[key], date);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
@@ -39,22 +45,28 @@ describe('Content Schedule', () => {
const date = new Date('2024-03-21');
const matchers = getAllScheduleMatchingGroups(date);
for (const key in matchers) {
validateMatcher(matchers[key], date);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
it('assembles scheduled items on october 7th', () => {
const date = 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);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
it('assembles scheduled items on november 1th', () => {
const date = new Date('2024-11-01');
const matchers = getAllScheduleMatchingGroups(date);
for (const key in matchers) {
validateMatcher(matchers[key], date);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
@@ -62,7 +74,9 @@ describe('Content Schedule', () => {
const date = new Date('2024-12-20');
const matchers = getAllScheduleMatchingGroups(date);
for (const key in matchers) {
validateMatcher(matchers[key], date);
if (matchers[key]) {
validateMatcher(matchers[key], date);
}
}
});
});