@@ -16,35 +16,35 @@ describe('isSupportOnline', () => {
1616 } ;
1717
1818 describe ( 'weekday support hours (Monday-Friday)' , ( ) => {
19- it ( 'should be online at 16 :00 UTC (Monday)' , ( ) => {
20- mockDate ( 16 , 1 ) ; // Monday, 16 :00 UTC
19+ it ( 'should be online at 04 :00 UTC (Monday)' , ( ) => {
20+ mockDate ( 4 , 1 ) ; // Monday, 04 :00 UTC
2121 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
2222 } ) ;
2323
24- it ( 'should be online at 20 :00 UTC (Tuesday)' , ( ) => {
25- mockDate ( 20 , 2 ) ; // Tuesday, 20 :00 UTC
24+ it ( 'should be online at 10 :00 UTC (Tuesday)' , ( ) => {
25+ mockDate ( 10 , 2 ) ; // Tuesday, 10 :00 UTC
2626 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
2727 } ) ;
2828
29- it ( 'should be online at 23 :59 UTC (Wednesday)' , ( ) => {
30- mockDate ( 23 , 3 ) ; // Wednesday, 23 :59 UTC
29+ it ( 'should be online at 16 :59 UTC (Wednesday)' , ( ) => {
30+ mockDate ( 16 , 3 ) ; // Wednesday, 16 :59 UTC
3131 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
3232 } ) ;
3333
34- it ( 'should be online at 23 :00 UTC (Thursday)' , ( ) => {
35- mockDate ( 23 , 4 ) ; // Thursday, 23 :00 UTC
34+ it ( 'should be online at 12 :00 UTC (Thursday)' , ( ) => {
35+ mockDate ( 12 , 4 ) ; // Thursday, 12 :00 UTC
3636 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
3737 } ) ;
3838
39- it ( 'should be online at 22 :00 UTC (Friday)' , ( ) => {
40- mockDate ( 22 , 5 ) ; // Friday, 22 :00 UTC
39+ it ( 'should be online at 08 :00 UTC (Friday)' , ( ) => {
40+ mockDate ( 8 , 5 ) ; // Friday, 08 :00 UTC
4141 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
4242 } ) ;
4343 } ) ;
4444
4545 describe ( 'outside support hours on weekdays' , ( ) => {
46- it ( 'should be offline at 15 :59 UTC (Monday)' , ( ) => {
47- mockDate ( 15 , 1 ) ; // Monday, 15 :59 UTC
46+ it ( 'should be offline at 03 :59 UTC (Monday)' , ( ) => {
47+ mockDate ( 3 , 1 ) ; // Monday, 03 :59 UTC
4848 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
4949 } ) ;
5050
@@ -53,20 +53,20 @@ describe('isSupportOnline', () => {
5353 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
5454 } ) ;
5555
56- it ( 'should be offline at 10 :00 UTC (Wednesday)' , ( ) => {
57- mockDate ( 10 , 3 ) ; // Wednesday, 10 :00 UTC
56+ it ( 'should be offline at 17 :00 UTC (Wednesday)' , ( ) => {
57+ mockDate ( 17 , 3 ) ; // Wednesday, 17 :00 UTC
5858 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
5959 } ) ;
6060
61- it ( 'should be offline at 14 :00 UTC (Friday)' , ( ) => {
62- mockDate ( 14 , 5 ) ; // Friday, 14 :00 UTC
61+ it ( 'should be offline at 23 :00 UTC (Friday)' , ( ) => {
62+ mockDate ( 23 , 5 ) ; // Friday, 23 :00 UTC
6363 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
6464 } ) ;
6565 } ) ;
6666
6767 describe ( 'weekends' , ( ) => {
6868 it ( 'should be offline on Saturday regardless of hour' , ( ) => {
69- mockDate ( 18 , 6 ) ; // Saturday, 18 :00 UTC (in support hours for weekdays)
69+ mockDate ( 10 , 6 ) ; // Saturday, 10 :00 UTC (in support hours for weekdays)
7070 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
7171 } ) ;
7272
@@ -80,25 +80,30 @@ describe('isSupportOnline', () => {
8080 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
8181 } ) ;
8282
83- it ( 'should be offline on Sunday at 16 :00' , ( ) => {
84- mockDate ( 16 , 0 ) ; // Sunday, 16 :00 UTC
83+ it ( 'should be offline on Sunday at 10 :00' , ( ) => {
84+ mockDate ( 10 , 0 ) ; // Sunday, 10 :00 UTC
8585 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
8686 } ) ;
8787 } ) ;
8888
8989 describe ( 'edge cases' , ( ) => {
90- it ( 'should handle boundary at 15 :59 (just before support hours)' , ( ) => {
91- mockDate ( 15 , 1 ) ; // Monday, 15 :59 UTC
90+ it ( 'should handle boundary at 03 :59 (just before support hours)' , ( ) => {
91+ mockDate ( 3 , 1 ) ; // Monday, 03 :59 UTC
9292 expect ( isSupportOnline ( ) ) . toBe ( false ) ;
9393 } ) ;
9494
95- it ( 'should handle boundary at 16 :00 (start of support hours)' , ( ) => {
96- mockDate ( 16 , 1 ) ; // Monday, 16 :00 UTC
95+ it ( 'should handle boundary at 04 :00 (start of support hours)' , ( ) => {
96+ mockDate ( 4 , 1 ) ; // Monday, 04 :00 UTC
9797 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
9898 } ) ;
9999
100- it ( 'should handle late night hours on Friday' , ( ) => {
101- mockDate ( 23 , 5 ) ; // Friday, 23:00 UTC
100+ it ( 'should handle boundary at 17:00 (end of support hours)' , ( ) => {
101+ mockDate ( 17 , 1 ) ; // Monday, 17:00 UTC
102+ expect ( isSupportOnline ( ) ) . toBe ( false ) ;
103+ } ) ;
104+
105+ it ( 'should handle boundary at 16:59 (just before end of support hours)' , ( ) => {
106+ mockDate ( 16 , 5 ) ; // Friday, 16:59 UTC
102107 expect ( isSupportOnline ( ) ) . toBe ( true ) ;
103108 } ) ;
104109 } ) ;
0 commit comments