@@ -9,7 +9,8 @@ test('renders single-line', () => {
9
9
37 ,
10
10
'#34AE17' ,
11
11
'left' ,
12
- false
12
+ false ,
13
+ null
13
14
)
14
15
15
16
const rendered = < Component > Test Content</ Component >
@@ -22,7 +23,10 @@ test('renders single-line', () => {
22
23
lineHeight : 51.8 ,
23
24
color : '#34AE17' ,
24
25
textAlign : 'left' ,
25
- flexShrink : 1
26
+ flexShrink : 1 ,
27
+ textDecorationLine : 'none' ,
28
+ textDecorationStyle : undefined ,
29
+ textDecorationColor : undefined
26
30
} }
27
31
numberOfLines = { 1 }
28
32
>
@@ -37,7 +41,8 @@ test('renders multi-line', () => {
37
41
37 ,
38
42
'#34AE17' ,
39
43
'left' ,
40
- true
44
+ true ,
45
+ null
41
46
)
42
47
43
48
const rendered = < Component > Test Content</ Component >
@@ -50,7 +55,10 @@ test('renders multi-line', () => {
50
55
lineHeight : 51.8 ,
51
56
color : '#34AE17' ,
52
57
textAlign : 'left' ,
53
- flexShrink : 1
58
+ flexShrink : 1 ,
59
+ textDecorationLine : 'none' ,
60
+ textDecorationStyle : undefined ,
61
+ textDecorationColor : undefined
54
62
} }
55
63
numberOfLines = { 0 }
56
64
>
@@ -59,13 +67,206 @@ test('renders multi-line', () => {
59
67
)
60
68
} )
61
69
70
+ test ( 'renders underlined' , ( ) => {
71
+ const Component = createTextComponent (
72
+ 'Test Font Family' ,
73
+ 37 ,
74
+ '#34AE17' ,
75
+ 'left' ,
76
+ false ,
77
+ { underline : true , strikethrough : false , style : 'solid' , color : 'blue' }
78
+ )
79
+
80
+ const rendered = < Component > Test Content</ Component >
81
+
82
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
83
+ < Text
84
+ style = { {
85
+ fontFamily : 'Test Font Family' ,
86
+ fontSize : 37 ,
87
+ lineHeight : 51.8 ,
88
+ color : '#34AE17' ,
89
+ textAlign : 'left' ,
90
+ flexShrink : 1 ,
91
+ textDecorationLine : 'underline' ,
92
+ textDecorationStyle : 'solid' ,
93
+ textDecorationColor : 'blue'
94
+ } }
95
+ numberOfLines = { 1 }
96
+ >
97
+ Test Content
98
+ </ Text >
99
+ )
100
+ } )
101
+
102
+ test ( 'renders strikethrough' , ( ) => {
103
+ const Component = createTextComponent (
104
+ 'Test Font Family' ,
105
+ 37 ,
106
+ '#34AE17' ,
107
+ 'left' ,
108
+ false ,
109
+ { underline : false , strikethrough : true , style : 'solid' , color : 'blue' }
110
+ )
111
+
112
+ const rendered = < Component > Test Content</ Component >
113
+
114
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
115
+ < Text
116
+ style = { {
117
+ fontFamily : 'Test Font Family' ,
118
+ fontSize : 37 ,
119
+ lineHeight : 51.8 ,
120
+ color : '#34AE17' ,
121
+ textAlign : 'left' ,
122
+ flexShrink : 1 ,
123
+ textDecorationLine : 'line-through' ,
124
+ textDecorationStyle : 'solid' ,
125
+ textDecorationColor : 'blue'
126
+ } }
127
+ numberOfLines = { 1 }
128
+ >
129
+ Test Content
130
+ </ Text >
131
+ )
132
+ } )
133
+
134
+ test ( 'renders underlined strikethrough' , ( ) => {
135
+ const Component = createTextComponent (
136
+ 'Test Font Family' ,
137
+ 37 ,
138
+ '#34AE17' ,
139
+ 'left' ,
140
+ false ,
141
+ { underline : true , strikethrough : true , style : 'solid' , color : 'blue' }
142
+ )
143
+
144
+ const rendered = < Component > Test Content</ Component >
145
+
146
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
147
+ < Text
148
+ style = { {
149
+ fontFamily : 'Test Font Family' ,
150
+ fontSize : 37 ,
151
+ lineHeight : 51.8 ,
152
+ color : '#34AE17' ,
153
+ textAlign : 'left' ,
154
+ flexShrink : 1 ,
155
+ textDecorationLine : 'underline line-through' ,
156
+ textDecorationStyle : 'solid' ,
157
+ textDecorationColor : 'blue'
158
+ } }
159
+ numberOfLines = { 1 }
160
+ >
161
+ Test Content
162
+ </ Text >
163
+ )
164
+ } )
165
+
166
+ test ( 'renders double' , ( ) => {
167
+ const Component = createTextComponent (
168
+ 'Test Font Family' ,
169
+ 37 ,
170
+ '#34AE17' ,
171
+ 'left' ,
172
+ false ,
173
+ { underline : true , strikethrough : false , style : 'double' , color : 'blue' }
174
+ )
175
+
176
+ const rendered = < Component > Test Content</ Component >
177
+
178
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
179
+ < Text
180
+ style = { {
181
+ fontFamily : 'Test Font Family' ,
182
+ fontSize : 37 ,
183
+ lineHeight : 51.8 ,
184
+ color : '#34AE17' ,
185
+ textAlign : 'left' ,
186
+ flexShrink : 1 ,
187
+ textDecorationLine : 'underline' ,
188
+ textDecorationStyle : 'double' ,
189
+ textDecorationColor : 'blue'
190
+ } }
191
+ numberOfLines = { 1 }
192
+ >
193
+ Test Content
194
+ </ Text >
195
+ )
196
+ } )
197
+
198
+ test ( 'renders dotted' , ( ) => {
199
+ const Component = createTextComponent (
200
+ 'Test Font Family' ,
201
+ 37 ,
202
+ '#34AE17' ,
203
+ 'left' ,
204
+ false ,
205
+ { underline : true , strikethrough : false , style : 'dotted' , color : 'blue' }
206
+ )
207
+
208
+ const rendered = < Component > Test Content</ Component >
209
+
210
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
211
+ < Text
212
+ style = { {
213
+ fontFamily : 'Test Font Family' ,
214
+ fontSize : 37 ,
215
+ lineHeight : 51.8 ,
216
+ color : '#34AE17' ,
217
+ textAlign : 'left' ,
218
+ flexShrink : 1 ,
219
+ textDecorationLine : 'underline' ,
220
+ textDecorationStyle : 'dotted' ,
221
+ textDecorationColor : 'blue'
222
+ } }
223
+ numberOfLines = { 1 }
224
+ >
225
+ Test Content
226
+ </ Text >
227
+ )
228
+ } )
229
+
230
+ test ( 'renders dashed' , ( ) => {
231
+ const Component = createTextComponent (
232
+ 'Test Font Family' ,
233
+ 37 ,
234
+ '#34AE17' ,
235
+ 'left' ,
236
+ false ,
237
+ { underline : true , strikethrough : false , style : 'dashed' , color : 'blue' }
238
+ )
239
+
240
+ const rendered = < Component > Test Content</ Component >
241
+
242
+ expect ( unwrapRenderedFunctionComponent ( rendered ) ) . toEqual (
243
+ < Text
244
+ style = { {
245
+ fontFamily : 'Test Font Family' ,
246
+ fontSize : 37 ,
247
+ lineHeight : 51.8 ,
248
+ color : '#34AE17' ,
249
+ textAlign : 'left' ,
250
+ flexShrink : 1 ,
251
+ textDecorationLine : 'underline' ,
252
+ textDecorationStyle : 'dashed' ,
253
+ textDecorationColor : 'blue'
254
+ } }
255
+ numberOfLines = { 1 }
256
+ >
257
+ Test Content
258
+ </ Text >
259
+ )
260
+ } )
261
+
62
262
test ( 'renders with onPress undefined' , ( ) => {
63
263
const Component = createTextComponent (
64
264
'Test Font Family' ,
65
265
37 ,
66
266
'#34AE17' ,
67
267
'left' ,
68
- false
268
+ false ,
269
+ null
69
270
)
70
271
71
272
const rendered = < Component onPress = { undefined } > Test Content</ Component >
@@ -78,7 +279,10 @@ test('renders with onPress undefined', () => {
78
279
lineHeight : 51.8 ,
79
280
color : '#34AE17' ,
80
281
textAlign : 'left' ,
81
- flexShrink : 1
282
+ flexShrink : 1 ,
283
+ textDecorationLine : 'none' ,
284
+ textDecorationStyle : undefined ,
285
+ textDecorationColor : undefined
82
286
} }
83
287
numberOfLines = { 1 }
84
288
>
@@ -93,7 +297,8 @@ test('renders with onPress set', () => {
93
297
37 ,
94
298
'#34AE17' ,
95
299
'left' ,
96
- false
300
+ false ,
301
+ null
97
302
)
98
303
const onPress = jest . fn ( )
99
304
@@ -107,7 +312,10 @@ test('renders with onPress set', () => {
107
312
lineHeight : 51.8 ,
108
313
color : '#34AE17' ,
109
314
textAlign : 'left' ,
110
- flexShrink : 1
315
+ flexShrink : 1 ,
316
+ textDecorationLine : 'none' ,
317
+ textDecorationStyle : undefined ,
318
+ textDecorationColor : undefined
111
319
} }
112
320
numberOfLines = { 1 }
113
321
onPress = { expect . any ( Function ) }
@@ -125,7 +333,8 @@ test('executes the press callback once when hitboxes are enabled', () => {
125
333
37 ,
126
334
'#34AE17' ,
127
335
'left' ,
128
- false
336
+ false ,
337
+ null
129
338
)
130
339
const onPress = jest . fn ( )
131
340
@@ -149,7 +358,8 @@ test('does not execute the press callback when hitboxes are disabled', () => {
149
358
37 ,
150
359
'#34AE17' ,
151
360
'left' ,
152
- false
361
+ false ,
362
+ null
153
363
)
154
364
const onPress = jest . fn ( )
155
365
0 commit comments