@@ -4,67 +4,105 @@ import { fixturesToRichText } from '../src/format';
4
4
describe ( 'Fixtures format' , ( ) => {
5
5
it ( 'expect no games' , ( ) => {
6
6
expect (
7
- fixturesToRichText ( {
8
- fixtures : [ ] ,
9
- date : new Date ( '2023-11-16T15:40:00.980Z' ) ,
10
- venue : 'Emirates Stadium' ,
11
- source : 'test.com'
12
- } )
7
+ fixturesToRichText (
8
+ {
9
+ fixtures : [ ] ,
10
+ date : new Date ( '2023-11-16T15:40:00.980Z' ) ,
11
+ venue : 'Emirates Stadium' ,
12
+ source : 'test.com'
13
+ } ,
14
+ new Date ( '2022-11-12T15:40:00.980Z' )
15
+ )
13
16
) . toBe ( `📟 *Update for Thu Nov 16 - 15:40 (2023)*
14
17
*No upcoming games for the year*
15
18
` ) ;
16
19
} ) ;
17
20
it ( 'expect single game' , ( ) => {
18
21
expect (
19
- fixturesToRichText ( {
20
- date : new Date ( '2023-11-16T15:40:00.980Z' ) ,
21
- venue : 'Emirates Stadium' ,
22
- fixtures : [
23
- {
24
- date : new Date ( '2023-12-16T15:40:00.980Z' ) ,
25
- venue : 'Emirates Stadium' ,
26
- leage : 'Premier League' ,
27
- homeTeam : 'Arsenal' ,
28
- awayTeam : 'Chelsea'
29
- }
30
- ] ,
31
- source : 'test.com'
32
- } )
22
+ fixturesToRichText (
23
+ {
24
+ date : new Date ( '2023-11-16T15:40:00.980Z' ) ,
25
+ venue : 'Emirates Stadium' ,
26
+ fixtures : [
27
+ {
28
+ date : new Date ( '2023-12-16T15:40:00.980Z' ) ,
29
+ venue : 'Emirates Stadium' ,
30
+ leage : 'Premier League' ,
31
+ homeTeam : 'Arsenal' ,
32
+ awayTeam : 'Chelsea'
33
+ }
34
+ ] ,
35
+ source : 'test.com'
36
+ } ,
37
+ new Date ( '2022-11-12T15:40:00.980Z' )
38
+ )
33
39
) . toBe ( `📟 *Update for Thu Nov 16 - 15:40 (2023)*
34
- ⚽ *Games at Emirates Stadium for this year *
40
+ ⚽ *2023 games at Emirates Stadium*
35
41
36
42
*Sat Dec 16 - 15:40* - Arsenal VS Chelsea (Premier League)
37
43
38
44
📡 [Source](test.com)
39
45
` ) ;
40
46
} ) ;
47
+
41
48
it ( 'expect today annotation game' , ( ) => {
42
49
expect (
43
- fixturesToRichText ( {
44
- date : new Date ( '2022-11-16T15:40:00.980Z' ) ,
45
- venue : 'Emirates Stadium' ,
46
- fixtures : [
47
- {
48
- date : new Date ( '2022-12-01' ) ,
49
- venue : 'Emirates Stadium' ,
50
- leage : 'Premier League' ,
51
- homeTeam : 'Arsenal' ,
52
- awayTeam : 'Chelsea'
53
- } ,
54
- {
55
- date : new Date ( '2022-11-16T15:40:00.980Z' ) ,
56
- venue : 'Emirates Stadium' ,
57
- leage : 'Premier League' ,
58
- homeTeam : 'Arsenal' ,
59
- awayTeam : 'Tel Aviv'
60
- }
61
- ] ,
62
- source : 'test.com'
63
- } )
50
+ fixturesToRichText (
51
+ {
52
+ date : new Date ( '2022-11-16T15:40:00.980Z' ) ,
53
+ venue : 'Emirates Stadium' ,
54
+ fixtures : [
55
+ {
56
+ date : new Date ( '2022-12-01' ) ,
57
+ venue : 'Emirates Stadium' ,
58
+ leage : 'Premier League' ,
59
+ homeTeam : 'Arsenal' ,
60
+ awayTeam : 'Chelsea'
61
+ }
62
+ ] ,
63
+ source : 'test.com'
64
+ } ,
65
+ new Date ( '2022-11-12T15:40:00.980Z' )
66
+ )
64
67
) . toBe ( `📟 *Update for Wed Nov 16 - 15:40 (2022)*
65
- ⚽ *Games at Emirates Stadium for this year *
68
+ ⚽ *2022 games at Emirates Stadium*
66
69
67
70
*Thu Dec 1 - 00:00* - Arsenal VS Chelsea (Premier League)
71
+
72
+ 📡 [Source](test.com)
73
+ ` ) ;
74
+ } ) ;
75
+
76
+ it ( 'expect today annotation game' , ( ) => {
77
+ expect (
78
+ fixturesToRichText (
79
+ {
80
+ date : new Date ( '2022-11-12T15:40:00.980Z' ) ,
81
+ venue : 'Emirates Stadium' ,
82
+ fixtures : [
83
+ {
84
+ date : new Date ( '2022-11-12T15:40:00.980Z' ) ,
85
+ venue : 'Emirates Stadium' ,
86
+ leage : 'Premier League' ,
87
+ homeTeam : 'Arsenal' ,
88
+ awayTeam : 'Chelsea'
89
+ } ,
90
+ {
91
+ date : new Date ( '2022-11-16T15:40:00.980Z' ) ,
92
+ venue : 'Emirates Stadium' ,
93
+ leage : 'Premier League' ,
94
+ homeTeam : 'Arsenal' ,
95
+ awayTeam : 'Tel Aviv'
96
+ }
97
+ ] ,
98
+ source : 'test.com'
99
+ } ,
100
+ new Date ( '2022-11-12T15:40:00.980Z' )
101
+ )
102
+ ) . toBe ( `📟 *Update for Sat Nov 12 - 15:40 (2022)*
103
+ ⚽ *2022 games at Emirates Stadium*
104
+
105
+ Today 👉 **Sat Nov 12 - 15:40* - Arsenal VS Chelsea (Premier League)
68
106
*Wed Nov 16 - 15:40* - Arsenal VS Tel Aviv (Premier League)
69
107
70
108
📡 [Source](test.com)
0 commit comments