Files
react-native-svg/__tests__/__snapshots__/css.test.tsx.snap
Wojciech Lewicki 3a04189df8 fix: reanimated on old architecture (#1869)
PR adding option for `Double` for all props that were of type `NumberProp` on `Android` so `reanimated` works the same as before on old architecture. It also introduces the change of how `fill` and `stroke` should be constructed for options not going through `render` method, e.g. `react-native-reanimated`. An example of how to handle it can be seen in the provided example: https://github.com/react-native-svg/react-native-svg/pull/1869/files#diff-76a76277daf14518270e8aea8a5e9358a8215d7e4276d2e5f1c4fe95107cdc20
2022-09-15 12:08:57 +02:00

217 lines
4.0 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`inlines styles 1`] = `
Object {
"Tag": [Function],
"children": Array [
<Defs>
<missingTag
type="text/css"
>
/* tag selector */
rect {
stroke: blue;
fill: yellow
}
/* class selector */
.redbox { fill: red; }
/* multiple selectors */
g .class-1, g .class-2 {
stroke-width: 16
}
/* two classes */
.class-2.transparent {
fill-opacity: 0.3;
}
/* Commented out
rect {
fill: black;
}
*/
</missingTag>
</Defs>,
<G>
<Rect
class="redbox class-1"
height={200}
style={
Object {
"fill": "red",
"stroke": "blue",
"strokeWidth": "16",
}
}
width={1000}
x={100}
y={0}
/>
</G>,
<G>
<Rect
class="redbox class-2 transparent"
height={200}
style={
Object {
"fill": "red",
"fillOpacity": "0.3",
"stroke": "blue",
"strokeWidth": "16",
}
}
width={750}
x={100}
y={350}
/>
</G>,
],
"parent": null,
"props": Object {
"height": "100%",
"version": 1.1,
"viewBox": "0 0 1000 500",
"width": "100%",
"xmlns": "http://www.w3.org/2000/svg",
},
"tag": "svg",
}
`;
exports[`supports CSS in style element 1`] = `
<RNSVGSvgView
align="xMidYMid"
bbHeight="100%"
bbWidth="100%"
focusable={false}
height="100%"
meetOrSlice={0}
minX={0}
minY={0}
style={
Array [
Object {
"backgroundColor": "transparent",
"borderWidth": 0,
},
Object {
"flex": 0,
"height": "100%",
"width": "100%",
},
]
}
vbHeight={500}
vbWidth={1000}
version={1.1}
width="100%"
xml="<?xml version=\\"1.0\\" standalone=\\"no\\"?>
<!DOCTYPE svg PUBLIC \\"-//W3C//DTD SVG 1.1//EN\\"
\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\">
<svg xmlns=\\"http://www.w3.org/2000/svg\\" version=\\"1.1\\"
width=\\"100%\\" height=\\"100%\\" viewBox=\\"0 0 1000 500\\">
<defs>
<style type=\\"text/css\\">
/* tag selector */
rect {
stroke: blue;
fill: yellow
}
/* class selector */
.redbox { fill: red; }
/* multiple selectors */
g .class-1, g .class-2 {
stroke-width: 16
}
/* two classes */
.class-2.transparent {
fill-opacity: 0.3;
}
/* Commented out
rect {
fill: black;
}
*/
</style>
</defs>
<g>
<rect class=\\"redbox class-1\\" x=\\"100\\" y=\\"0\\" width=\\"1000\\" height=\\"200\\" />
</g>
<g>
<rect class=\\"redbox class-2 transparent\\" x=\\"100\\" y=\\"350\\" width=\\"750\\" height=\\"200\\" />
</g>
</svg>"
xmlns="http://www.w3.org/2000/svg"
>
<RNSVGGroup>
<RNSVGDefs />
<RNSVGGroup>
<RNSVGRect
fill={
Object {
"payload": 4294901760,
"type": 0,
}
}
height="200"
propList={
Array [
"fill",
"stroke",
"strokeWidth",
]
}
stroke={
Object {
"payload": 4278190335,
"type": 0,
}
}
strokeWidth="16"
width="1000"
x="100"
y="0"
/>
</RNSVGGroup>
<RNSVGGroup>
<RNSVGRect
fill={
Object {
"payload": 4294901760,
"type": 0,
}
}
fillOpacity={0.3}
height="200"
propList={
Array [
"fill",
"fillOpacity",
"stroke",
"strokeWidth",
]
}
stroke={
Object {
"payload": 4278190335,
"type": 0,
}
}
strokeWidth="16"
width="750"
x="100"
y="350"
/>
</RNSVGGroup>
</RNSVGGroup>
</RNSVGSvgView>
`;