test(e2e): avoid relying on CDN + reduce debounce delay

This commit is contained in:
Evan You
2019-12-11 10:37:03 -05:00
parent 4d730f464d
commit b983c68575
8 changed files with 30 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ describe('e2e: markdown', () => {
async function testMarkdown(apiType: 'classic' | 'composition') {
const baseUrl = `file://${path.resolve(
__dirname,
`../${apiType}/markdown.html`
`../${apiType}/markdown.html#test`
)}`
await page().goto(baseUrl)
@@ -18,7 +18,7 @@ describe('e2e: markdown', () => {
await page().type('textarea', '\n## foo\n\n- bar\n- baz')
// assert the output is not updated yet because of debounce
expect(await html('#editor div')).toBe('<h1 id="hello">hello</h1>\n')
await page().waitFor(500)
await page().waitFor(16)
expect(await html('#editor div')).toBe(
'<h1 id="hello">hello</h1>\n' +
'<h2 id="foo">foo</h2>\n' +