/
attributes-to-props.test.js.snap
121 lines (111 loc) 路 2.96 KB
/
attributes-to-props.test.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`attributesToProps with HTML attribute converts RDFa attributes to React props 1`] = `
Object {
"property": "foo",
"typeof": "bar",
}
`;
exports[`attributesToProps with HTML attribute converts attributes to React props 1`] = `
Object {
"className": "ic",
"htmlFor": "tran",
"httpEquiv": "refresh",
}
`;
exports[`attributesToProps with HTML attribute converts attributes with weird capitalization 1`] = `
Object {
"acceptCharset": "ISO-8859-1",
"data-FOO": "bar",
"formNoValidate": true,
"security": "restricted",
}
`;
exports[`attributesToProps with HTML attribute converts boolean attributes 1`] = `
Object {
"allowFullScreen": true,
"allowpaymentrequest": "",
"async": true,
"autoFocus": true,
"autoPlay": true,
"checked": true,
"controls": true,
"default": true,
"disabled": true,
"draggable": "false",
"formNoValidate": true,
"hidden": true,
"ismap": "",
"itemScope": true,
"loop": true,
"multiple": true,
"muted": true,
"noModule": true,
"noValidate": true,
"open": true,
"playsInline": true,
"readOnly": true,
"required": true,
"reversed": true,
"selected": true,
"truespeed": "",
}
`;
exports[`attributesToProps with HTML attribute converts non-standard attributes to React props 1`] = `
Object {
"itemID": 1337,
"itemScope": true,
}
`;
exports[`attributesToProps with HTML attribute converts standard attributes to React props 1`] = `
Object {
"allowFullScreen": true,
"charSet": "utf-8",
"tabIndex": 1,
}
`;
exports[`attributesToProps with HTML attribute keeps \`data-*\` and \`aria-*\` attributes as is 1`] = `
Object {
"aria-live": "polite",
"data-foo": "bar",
}
`;
exports[`attributesToProps with SVG attribute converts attributes to React props 1`] = `
Object {
"edgeMode": "edgeMode",
"fillOpacity": "0.42",
"fillRule": "evenodd",
"glyphOrientationVertical": "auto",
"horizAdvX": "9001",
"stroke": "none",
"xmlBase": "http://example.org",
}
`;
exports[`attributesToProps with custom attribute converts attributes named after Object properties 1`] = `
Object {
"__defineGetter__": "",
"__defineSetter__": "",
"__lookupGetter__": "",
"__lookupSetter__": "",
"hasOwnProperty": "",
"isPrototypeOf": "",
"propertyIsEnumerable": "",
"toLocaleString": "",
"toString": "",
"valueOf": "",
}
`;
exports[`attributesToProps with style attribute parses CSS style to JS object 1`] = `
Object {
"style": Object {
"--custom-property": "#f00",
"MozBorderRadiusBottomleft": "20px'",
"WebkitBorderTopRightRadius": "10rem",
"background": "url(data:image/png; base64,ivborw0kggoaaaansaaaabgdbtueaalgpc/xhbqaaaafzmuexurczmzpf399fx1+bm5mzy9avzxbesmgces5/p8/t9furvcrmu73jwlzosgsiizurcjo/ad+eqjjb4hv8bft+idpqocx1wjosbfhh2xssxeiyn3uli/6mnree07uiwjev8u8czwyuqdlkpg1bkb4nnm+veanfhqn1k4+gpt6ugqcvu2h2ovuif)",
"borderBottomLeftRadius": "1em",
"borderRightStyle": "solid",
"color": "#f00",
"fontSize": "42px",
"zIndex": "-1",
},
}
`;