Skip to content

Commit f0c6e5c

Browse files
committed
add test for broken parsing
1 parent 6dd4e3e commit f0c6e5c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/render/src/shared/utils/pretty.spec.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ describe('pretty', () => {
1818
expect(pretty(document, { lineBreak: '\n' })).toMatchSnapshot();
1919
});
2020

21-
it('should print style properties per-line once they get too wide', () => {
22-
const document =
23-
'<div style="width:100%;border:none;border-top:1px solid #eaeaea;border-color:#e6ebf1;margin:20px 0;font-family:&quot;Google Sans&quot;"></div>';
24-
expect(pretty(document, { lineBreak: '\n' })).toMatchSnapshot();
21+
describe('style attribute formatting', () => {
22+
it('should print properties per-line once they get too wide', () => {
23+
const document =
24+
'<div style="width:100%;border:none;border-top:1px solid #eaeaea;border-color:#e6ebf1;margin:20px 0;font-family:&quot;Google Sans&quot;"></div>';
25+
expect(pretty(document, { lineBreak: '\n' })).toMatchSnapshot();
26+
});
27+
28+
it.only('should work with an img element', () => {
29+
const document =
30+
'<img alt="Stagg Electric Kettle" style="border-radius:12px;border:none;display:block;object-fit:cover;outline:none;text-decoration:none;width:100%;" height="288 src="/static/stagg-eletric-kettle.jpg" />';
31+
expect(pretty(document, { lineBreak: '\n' })).toMatchSnapshot();
32+
});
2533
});
2634

2735
it("should prettify Stripe's template correctly", () => {

0 commit comments

Comments
 (0)