-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.spec.ts
More file actions
30 lines (29 loc) · 1.09 KB
/
index.spec.ts
File metadata and controls
30 lines (29 loc) · 1.09 KB
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
import "./block"
import "./inline"
import { dom } from "@typeup/dom"
import { renderer } from "./index"
describe("renderer", () => {
it.each([
() => new dom.Document([new dom.Block.Paragraph([new dom.Inline.Text("Hello, world!")])]),
() => new dom.Document([new dom.Block.Paragraph([new dom.Inline.Text("Test content")])]),
() =>
new dom.Document([
new dom.Block.Paragraph([new dom.Inline.Text("First paragraph")]),
new dom.Block.Paragraph([new dom.Inline.Text("Second paragraph")]),
]),
() =>
new dom.Document([
new dom.Block.Heading(1, [new dom.Inline.Text("Main Title")]),
new dom.Block.Paragraph([new dom.Inline.Text("Content under title")]),
]),
() =>
new dom.Document([
new dom.Block.Paragraph([
new dom.Inline.Text("This is "),
new dom.Inline.Emphasize([new dom.Inline.Text("emphasized")]),
new dom.Inline.Text(" text."),
]),
]),
() => new dom.Document([new dom.Block.Math("x^2 + y^2 = z^2", [new dom.Inline.Text("Pythagorean theorem")])]),
])("render(%s)", async document => expect(await renderer.render(document())).toMatchSnapshot())
})