mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-30 09:45:11 +01:00
Fix datelib test
This commit is contained in:
@@ -31,7 +31,10 @@ describe("factorRange", () => {
|
||||
|
||||
// End should be 10 days from now
|
||||
expect(end).toBeInstanceOf(Date);
|
||||
expect(end.getFullYear()).toBe(new Date().setDate(new Date().getDate() + 10).getFullYear());
|
||||
// Set the future date so it works even in late december when the year changes
|
||||
let futureDate = new Date()
|
||||
futureDate.setDate(futureDate.getDate()) + 10
|
||||
expect(end.getFullYear()).toBe(futureDate.getFullYear());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,4 +43,4 @@ describe("parse", () => {
|
||||
const date = parse("2020-02-01");
|
||||
expect(date).toBeInstanceOf(Date);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user