-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshouldParseMD.html
54 lines (38 loc) · 1.1 KB
/
shouldParseMD.html
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
<!DOCTYPE html>
<meta lang="en">
<title>Should parce markdown</title>
<script async src="../mark-down.js" type="module"></script>
<mark-down>
# A Title
A paragraph
* With
* Some
* List
</mark-down>
<script type="module">
const { assert, assertEqual, runTests, waitFor } = await import('./test-utils.js');
let markDown;
async function setup() {
markDown = document.querySelector('mark-down');
await waitFor(() => markDown.shadowRoot);
}
const tests = {
shouldConvertH1() {
const h1 = markDown.shadowRoot.querySelector('h1');
assert(h1, '<h1> is present');
assertEqual(h1.textContent, 'A Title', '<h1>.textContent');
},
shouldConvertP() {
const p = markDown.shadowRoot.querySelector('p');
assert(p, '<p> is present');
assertEqual(p.textContent, 'A paragraph', '<p>.textContent');
},
shouldConvertUL() {
const ul = markDown.shadowRoot.querySelector('ul');
assert(ul, '<ul> is present');
assertEqual(ul.textContent, '\nWith\nSome\nList\n', '<ul>.textContent');
},
}
await setup();
runTests(tests);
</script>