@@ -5,52 +5,44 @@ import { createMeetingConfig, createMockEvent } from './helpers.mjs';
55import * as calendar from '../src/calendar.mjs' ;
66
77describe ( 'calendar.mjs' , ( ) => {
8- describe ( 'getWeekBounds ' , ( ) => {
9- it ( 'should return a week starting from the given date at UTC midnight ' , ( ) => {
8+ describe ( 'getNextWeek ' , ( ) => {
9+ it ( 'should return a week starting from the given date' , ( ) => {
1010 const testDate = new Date ( '2025-01-15T10:30:00Z' ) ;
11- const [ start ] = calendar . getWeekBounds ( testDate ) ;
11+ const [ start ] = calendar . getNextWeek ( testDate ) ;
1212
13- assert . strictEqual ( start . getTime ( ) , 1736899200000 ) ;
13+ assert . strictEqual ( start , testDate ) ;
1414 } ) ;
1515
1616 it ( 'should return a week end 7 days after the start' , ( ) => {
1717 const testDate = new Date ( '2025-01-15T00:00:00Z' ) ;
18- const [ start , end ] = calendar . getWeekBounds ( testDate ) ;
18+ const [ start , end ] = calendar . getNextWeek ( testDate ) ;
1919 const diffDays = ( end - start ) / ( 1000 * 60 * 60 * 24 ) ;
2020
2121 assert . strictEqual ( diffDays , 7 ) ;
2222 } ) ;
2323
2424 it ( 'should use current date when no date is provided' , ( ) => {
25- const [ start , end ] = calendar . getWeekBounds ( ) ;
25+ const [ start , end ] = calendar . getNextWeek ( ) ;
2626
2727 assert ( start <= new Date ( ) ) ;
2828 assert ( end >= new Date ( ) ) ;
2929 } ) ;
3030
3131 it ( 'should handle dates across year boundaries' , ( ) => {
3232 const testDate = new Date ( '2024-12-30T00:00:00Z' ) ;
33- const [ start , weekEnd ] = calendar . getWeekBounds ( testDate ) ;
33+ const [ start , weekEnd ] = calendar . getNextWeek ( testDate ) ;
3434
3535 assert . strictEqual ( start . getUTCFullYear ( ) , 2024 ) ;
3636 assert . strictEqual ( weekEnd . getUTCFullYear ( ) , 2025 ) ;
3737 } ) ;
3838
3939 it ( 'should handle leap year dates' , ( ) => {
4040 const testDate = new Date ( '2024-02-28T00:00:00Z' ) ;
41- const [ start , end ] = calendar . getWeekBounds ( testDate ) ;
41+ const [ start , end ] = calendar . getNextWeek ( testDate ) ;
4242
4343 assert ( start < end ) ;
4444 assert . strictEqual ( ( end - start ) / ( 1000 * 60 * 60 * 24 ) , 7 ) ;
4545 } ) ;
46-
47- it ( 'should maintain UTC timezone context' , ( ) => {
48- const testDate = new Date ( '2025-01-15T23:59:59Z' ) ;
49- const [ start ] = calendar . getWeekBounds ( testDate ) ;
50-
51- assert . strictEqual ( start . getUTCHours ( ) , 0 ) ;
52- assert . strictEqual ( start . getUTCMinutes ( ) , 0 ) ;
53- } ) ;
5446 } ) ;
5547
5648 describe ( 'findNextMeetingDate' , ( ) => {
0 commit comments