MCPcopy
hub / github.com/vuejs/core / testMarkdown

Function testMarkdown

packages/vue/__tests__/e2e/markdown.spec.ts:7–30  ·  view source on GitHub ↗
(apiType: 'classic' | 'composition')

Source from the content-addressed store, hash-verified

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',

Callers 1

markdown.spec.tsFile · 0.85

Calls 6

expectByPollingFunction · 0.90
gotoMethod · 0.80
isVisibleFunction · 0.70
valueFunction · 0.70
htmlFunction · 0.70
resolveMethod · 0.65

Tested by

no test coverage detected