Skip to content

Commit 82b87c5

Browse files
committed
add basic test
1 parent 7a34422 commit 82b87c5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@ exports[`pretty > should prettify Preview component's complex characters correct
223223
"
224224
`;
225225
226+
exports[`pretty > should prettify base doucment correctly 1`] = `
227+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
228+
<html>
229+
<head></head>
230+
<body style="background-color:#fff;">
231+
<h1>
232+
whatever
233+
</h1>
234+
<input placeholder="hello world"/>
235+
</body>
236+
</html>
237+
"
238+
`;
226239
exports[`wrapText() 1`] = `
227240
"Lorem
228241
ipsum

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('lenientParse()', () => {
1717
describe('pretty', () => {
1818
it('should prettify base doucment correctly', () => {
1919
const document = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head></head><body style="background-color:#fff;"><h1>whatever</h1><input placeholder="hello world"/></body></html>`;
20-
expect(pretty(document, { lineBreak: '\n' })).toBe('');
20+
expect(pretty(document, { lineBreak: '\n' })).toMatchSnapshot();
2121
});
2222

2323
// it("should prettify Preview component's complex characters correctly", async () => {

0 commit comments

Comments
 (0)