From 2c334c4e5a9e4076bd4a75c7941733cbdf683768 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 27 Nov 2025 15:53:10 +0100 Subject: [PATCH] fix(test): proper rebase --- test/calendar.test.mjs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/test/calendar.test.mjs b/test/calendar.test.mjs index 38a7501..9ff5a2c 100644 --- a/test/calendar.test.mjs +++ b/test/calendar.test.mjs @@ -5,24 +5,24 @@ import { createMeetingConfig, createMockEvent } from './helpers.mjs'; import * as calendar from '../src/calendar.mjs'; describe('calendar.mjs', () => { - describe('getWeekBounds', () => { - it('should return a week starting from the given date at UTC midnight', () => { + describe('getNextWeek', () => { + it('should return a week starting from the given date', () => { const testDate = new Date('2025-01-15T10:30:00Z'); - const [start] = calendar.getWeekBounds(testDate); + const [start] = calendar.getNextWeek(testDate); - assert.strictEqual(start.getTime(), 1736899200000); + assert.strictEqual(start, testDate); }); it('should return a week end 7 days after the start', () => { const testDate = new Date('2025-01-15T00:00:00Z'); - const [start, end] = calendar.getWeekBounds(testDate); + const [start, end] = calendar.getNextWeek(testDate); const diffDays = (end - start) / (1000 * 60 * 60 * 24); assert.strictEqual(diffDays, 7); }); it('should use current date when no date is provided', () => { - const [start, end] = calendar.getWeekBounds(); + const [start, end] = calendar.getNextWeek(); assert(start <= new Date()); assert(end >= new Date()); @@ -30,7 +30,7 @@ describe('calendar.mjs', () => { it('should handle dates across year boundaries', () => { const testDate = new Date('2024-12-30T00:00:00Z'); - const [start, weekEnd] = calendar.getWeekBounds(testDate); + const [start, weekEnd] = calendar.getNextWeek(testDate); assert.strictEqual(start.getUTCFullYear(), 2024); assert.strictEqual(weekEnd.getUTCFullYear(), 2025); @@ -38,19 +38,11 @@ describe('calendar.mjs', () => { it('should handle leap year dates', () => { const testDate = new Date('2024-02-28T00:00:00Z'); - const [start, end] = calendar.getWeekBounds(testDate); + const [start, end] = calendar.getNextWeek(testDate); assert(start < end); assert.strictEqual((end - start) / (1000 * 60 * 60 * 24), 7); }); - - it('should maintain UTC timezone context', () => { - const testDate = new Date('2025-01-15T23:59:59Z'); - const [start] = calendar.getWeekBounds(testDate); - - assert.strictEqual(start.getUTCHours(), 0); - assert.strictEqual(start.getUTCMinutes(), 0); - }); }); describe('findNextMeetingDate', () => {