Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

Update datelib.test.ts

Katos6a54b66fecec
diff --git a/frontend/lib/datelib/datelib.test.ts b/frontend/lib/datelib/datelib.test.ts
index 0504de6b..d994c82f 100644
--- a/frontend/lib/datelib/datelib.test.ts
+++ b/frontend/lib/datelib/datelib.test.ts
@@ -25,15 +25,18 @@ describe("zeroTime", () => {
describe("factorRange", () => {
test("should return a range of dates", () => {
const [start, end] = factorRange(10);
+
// Start should be today
expect(start).toBeInstanceOf(Date);
expect(start.getFullYear()).toBe(new Date().getFullYear());
// End should be 10 days from now
expect(end).toBeInstanceOf(Date);
- // Set the future date so it works even in late december when the year changes
- let futureDate = new Date()
- futureDate.setDate(futureDate.getDate()) + 10
+
+ // Set the future date so it works even in late December when the year changes
+ let futureDate = new Date();
+ futureDate.setDate(futureDate.getDate() + 10); // Adds 10 days to the current date
+
expect(end.getFullYear()).toBe(futureDate.getFullYear());
});
});
@@ -43,4 +46,4 @@ describe("parse", () => {
const date = parse("2020-02-01");
expect(date).toBeInstanceOf(Date);
});
-});
\ No newline at end of file
+});