(apiType: 'classic' | 'composition')
| 5 | const { page, isVisible, value, html } = setupPuppeteer() |
| 6 | |
| 7 | async function testMarkdown(apiType: 'classic' | 'composition') { |
| 8 | const baseUrl = `file://${path.resolve( |
| 9 | __dirname, |
| 10 | `../../examples/${apiType}/markdown.html#test`, |
| 11 | )}` |
| 12 | |
| 13 | await page().goto(baseUrl) |
| 14 | expect(await isVisible('#editor')).toBe(true) |
| 15 | expect(await value('textarea')).toBe('# hello') |
| 16 | expect(await html('#editor div')).toBe('<h1>hello</h1>\n') |
| 17 | |
| 18 | await page().type('textarea', '\n## foo\n\n- bar\n- baz') |
| 19 | |
| 20 | // assert the output is not updated yet because of debounce |
| 21 | // debounce has become unstable on CI so this assertion is disabled |
| 22 | // expect(await html('#editor div')).toBe('<h1 id="hello">hello</h1>\n') |
| 23 | |
| 24 | await expectByPolling( |
| 25 | () => html('#editor div'), |
| 26 | '<h1>hello</h1>\n' + |
| 27 | '<h2>foo</h2>\n' + |
| 28 | '<ul>\n<li>bar</li>\n<li>baz</li>\n</ul>\n', |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | test( |
| 33 | 'classic', |
no test coverage detected