@@ -316,42 +316,42 @@ describe('TimePlanningsTableComponent', () => {
316316 } ) ;
317317 } ) ;
318318
319- // describe('isInOlderThanToday', () => {
320- // it('should return false for null date', () => {
321- // expect(component.isInOlderThanToday(null as any)).toBe(false);
322- // });
323- //
324- // it('should return false for undefined date', () => {
325- // expect(component.isInOlderThanToday(undefined as any)).toBe(false);
326- // });
327- //
328- // it('should return true for date in the past', () => {
329- // const pastDate = new Date();
330- // pastDate.setDate(pastDate.getDate() - 5);
331- // expect(component.isInOlderThanToday(pastDate)).toBe(true);
332- // });
333- //
334- // it('should return false for today', () => {
335- // const today = new Date();
336- // expect(component.isInOlderThanToday(today)).toBe(false);
337- // });
338- //
339- // it('should return false for future date', () => {
340- // const futureDate = new Date();
341- // futureDate.setDate(futureDate.getDate() + 5);
342- // expect(component.isInOlderThanToday(futureDate)).toBe(false);
343- // });
344- //
345- // it('should handle string dates', () => {
346- // const pastDateString = '2020-01-01';
347- // expect(component.isInOlderThanToday(pastDateString as any)).toBe(true);
348- // });
349- //
350- // it('should return false for invalid date string', () => {
351- // const invalidDate = 'invalid-date';
352- // expect(component.isInOlderThanToday(invalidDate as any)).toBe(false);
353- // });
354- // });
319+ describe ( 'isInOlderThanToday' , ( ) => {
320+ it ( 'should return false for null date' , ( ) => {
321+ expect ( component . isInOlderThanToday ( null as any ) ) . toBe ( false ) ;
322+ } ) ;
323+
324+ it ( 'should return false for undefined date' , ( ) => {
325+ expect ( component . isInOlderThanToday ( undefined as any ) ) . toBe ( false ) ;
326+ } ) ;
327+
328+ it ( 'should return true for date in the past' , ( ) => {
329+ const pastDate = new Date ( ) ;
330+ pastDate . setDate ( pastDate . getDate ( ) - 5 ) ;
331+ expect ( component . isInOlderThanToday ( pastDate ) ) . toBe ( true ) ;
332+ } ) ;
333+
334+ it ( 'should return false for today' , ( ) => {
335+ const today = new Date ( ) ;
336+ expect ( component . isInOlderThanToday ( today ) ) . toBe ( false ) ;
337+ } ) ;
338+
339+ it ( 'should return false for future date' , ( ) => {
340+ const futureDate = new Date ( ) ;
341+ futureDate . setDate ( futureDate . getDate ( ) + 5 ) ;
342+ expect ( component . isInOlderThanToday ( futureDate ) ) . toBe ( false ) ;
343+ } ) ;
344+
345+ it ( 'should handle string dates' , ( ) => {
346+ const pastDateString = '2020-01-01' ;
347+ expect ( component . isInOlderThanToday ( pastDateString as any ) ) . toBe ( true ) ;
348+ } ) ;
349+
350+ it ( 'should return false for invalid date string' , ( ) => {
351+ const invalidDate = 'invalid-date' ;
352+ expect ( component . isInOlderThanToday ( invalidDate as any ) ) . toBe ( false ) ;
353+ } ) ;
354+ } ) ;
355355
356356 describe ( 'getStopTimeDisplay' , ( ) => {
357357 it ( 'should return empty string when startedAt is null' , ( ) => {
0 commit comments