Skip to content

Commit 6a3116a

Browse files
javachefacebook-github-bot
authored andcommitted
Add screenshot tests for LinearGradient (#52128)
Summary: Pull Request resolved: #52128 Changelog: [Internal] Reviewed By: andrewdacenko Differential Revision: D76972006 fbshipit-source-id: 657b78a842578df46f81d2416726665f49655a4f
1 parent 432ad09 commit 6a3116a

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

packages/rn-tester/js/examples/LinearGradient/LinearGradientExample.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ exports.examples = [
5151
{
5252
title: 'Basic Linear Gradient',
5353
description: 'Linear gradient from top to bottom',
54+
name: 'basic',
5455
render(): React.Node {
5556
return (
5657
<GradientBox
@@ -66,6 +67,7 @@ exports.examples = [
6667
{
6768
title: 'Linear Gradient with corner angle',
6869
description: 'Rectangular Linear gradient with corner angle',
70+
name: 'corner-angle',
6971
render(): React.Node {
7072
return (
7173
<GradientBox
@@ -74,64 +76,68 @@ exports.examples = [
7476
height: 300,
7577
width: 140,
7678
}}
77-
testID="linear-gradient-rectangular-with-corner-angle"
79+
testID="linear-gradient-corner-angle"
7880
/>
7981
);
8082
},
8183
},
8284
{
8385
title: 'Multiple linear gradients',
86+
name: 'multiple',
8487
render(): React.Node {
8588
return (
8689
<GradientBox
87-
testID="linear-gradient-multiple"
8890
style={{
8991
experimental_backgroundImage: `
90-
linear-gradient(0deg, white, rgba(238, 64, 53, 0.8), rgba(238, 64, 53, 0) 70%),
91-
linear-gradient(45deg, white, rgba(243, 119, 54, 0.8), rgba(243, 119, 54, 0) 70%),
92-
linear-gradient(90deg, white, rgba(253, 244, 152, 0.8), rgba(253, 244, 152, 0) 70%),
93-
linear-gradient(135deg, white, rgba(123, 192, 67, 0.8), rgba(123, 192, 67, 0) 70%),
92+
linear-gradient(0deg, white, rgba(238, 64, 53, 0.8), rgba(238, 64, 53, 0) 70%),
93+
linear-gradient(45deg, white, rgba(243, 119, 54, 0.8), rgba(243, 119, 54, 0) 70%),
94+
linear-gradient(90deg, white, rgba(253, 244, 152, 0.8), rgba(253, 244, 152, 0) 70%),
95+
linear-gradient(135deg, white, rgba(123, 192, 67, 0.8), rgba(123, 192, 67, 0) 70%),
9496
linear-gradient(180deg, white, rgba(3, 146, 207, 0.8), rgba(3, 146, 207, 0) 70%);
9597
9698
`,
9799
borderRadius: 16,
98100
}}
101+
testID="linear-gradient-multiple"
99102
/>
100103
);
101104
},
102105
},
103106
{
104107
title: 'Diagonal Gradient',
105108
description: 'Linear gradient from top-left to bottom-right',
109+
name: 'diagonal',
106110
render(): React.Node {
107111
return (
108112
<GradientBox
109-
testID="linear-gradient-diagonal"
110113
style={{
111114
experimental_backgroundImage:
112115
'linear-gradient(to bottom right, yellow, green)',
113116
}}
117+
testID="linear-gradient-diagonal"
114118
/>
115119
);
116120
},
117121
},
118122
{
119123
title: 'Gradient with angle',
120124
description: 'Linear gradient with angle',
125+
name: 'angle',
121126
render(): React.Node {
122127
return (
123128
<GradientBox
124-
testID="linear-gradient-angle"
125129
style={{
126130
experimental_backgroundImage:
127131
'linear-gradient(135deg, gray, brown)',
128132
}}
133+
testID="linear-gradient-angle"
129134
/>
130135
);
131136
},
132137
},
133138
{
134139
title: 'Multiple Color Stops',
140+
name: 'color-stops',
135141
render(): React.Node {
136142
return (
137143
<GradientBox
@@ -146,6 +152,7 @@ exports.examples = [
146152
},
147153
{
148154
title: 'Linear gradient with object style syntax',
155+
name: 'object-style-syntax',
149156
render(): React.Node {
150157
return (
151158
<GradientBox
@@ -168,41 +175,43 @@ exports.examples = [
168175
},
169176
{
170177
title: 'Gradient with uniform border style',
178+
name: 'uniform-borders',
171179
render(): React.Node {
172180
return (
173181
<GradientBox
174-
testID="linear-gradient-with-uniform-borders"
175182
style={{
176183
experimental_backgroundImage:
177184
'linear-gradient(to bottom right, yellow, green);',
178185
borderRadius: 16,
179186
}}
187+
testID="linear-gradient-uniform-borders"
180188
/>
181189
);
182190
},
183191
},
184192
{
185193
title: 'Gradient with non-uniform border style',
194+
name: 'non-uniform-borders',
186195
render(): React.Node {
187196
return (
188197
<GradientBox
189-
testID="linear-gradient-with-non-uniform-borders"
190198
style={{
191199
experimental_backgroundImage:
192200
'linear-gradient(to bottom right, yellow, green);',
193201
borderTopRightRadius: 8,
194202
borderTopLeftRadius: 80,
195203
}}
204+
testID="linear-gradient-non-uniform-borders"
196205
/>
197206
);
198207
},
199208
},
200209
{
201210
title: 'Gradient with Platform colors',
211+
name: 'platform-colors',
202212
render(): React.Node {
203213
return (
204214
<GradientBox
205-
testID="linear-gradient-with-non-uniform-borders"
206215
style={{
207216
experimental_backgroundImage: [
208217
{
@@ -222,12 +231,14 @@ exports.examples = [
222231
},
223232
],
224233
}}
234+
testID="linear-gradient-platform-colors"
225235
/>
226236
);
227237
},
228238
},
229239
{
230240
title: 'Transition hint',
241+
name: 'transition-hint',
231242
render(): React.Node {
232243
return (
233244
<GradientBox
@@ -240,7 +251,8 @@ exports.examples = [
240251
},
241252
},
242253
{
243-
title: 'with px and % combination',
254+
title: 'Gradient with px and % combination',
255+
name: 'px-and-percentage',
244256
render(): React.Node {
245257
return (
246258
<GradientBox
@@ -256,7 +268,7 @@ exports.examples = [
256268
#2e3192 100%
257269
);`,
258270
}}
259-
testID="linear-gradient-transition-hint"
271+
testID="linear-gradient-px-and-percentage"
260272
/>
261273
);
262274
},

0 commit comments

Comments
 (0)