also looking at this
fix(native): preserve explicit grid row tracks
#2092
5 files
+42
-4
| @@ -16,6 +16,21 @@ describe('shared native inline-style normalization', () => { | ||
| 16 | 16 | expect(parseNativeStyle({ fontWeight: 700 })).toEqual({ fontWeight: '700' }) |
| 17 | 17 | }) |
| 18 | 18 | |
| 19 | it('preserves explicit grid row tracks in object, serialized and CSS styles', async () => { | |
| 20 | for (const rows of ['repeat(2, 1fr)', '1fr 1fr', 2]) { | |
| 21 | const expected = { display: 'grid', gridTemplateRows: rows } | |
| 22 | for (const input of [expected, JSON.stringify(expected)]) { | |
| 23 | const diagnostics: NativeStyleDiagnostic[] = [] | |
| 24 | expect(parseNativeStyle(input, d => diagnostics.push(d))).toEqual(expected) | |
| 25 | expect(diagnostics).toEqual([]) | |
| 26 | } | |
| 27 | } | |
| 28 | const css = 'display:grid;grid-template-rows:repeat(2, 1fr)' | |
| 29 | expect(parseNativeStyle(css)).toEqual({ display: 'grid', gridTemplateRows: 'repeat(2, 1fr)' }) | |
| 30 | expect((await translateHtmlToIR(`<div style="${css}"><span>row</span></div>`)).root.style) | |
| 31 | .toEqual({ display: 'grid', gridTemplateRows: 'repeat(2, 1fr)' }) | |
| 32 | }) | |
| 33 | ||
| 19 | 34 | it('does not corrupt quoted font names or semicolons in CSS function values', () => { |
| 20 | 35 | const image = 'url("data:image/svg+xml;base64,abc")' |
| 21 | 36 | expect(parseNativeStyle(`background-image:${image};font-family:"A;B";padding:8px`)) |