Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Aug 18, 2023
1 parent 13343c9 commit 9ae9487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions __tests__/e2e/markdown-extensions/markdown-extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,19 @@ describe('Line Numbers', () => {
describe('Import Code Snippets', () => {
test('basic', async () => {
const lines = page.locator('#basic-code-snippet + div code > span')
expect(await lines.count()).toBe(11)
expect(await lines.count()).toBe(22)
})

test('specify region', async () => {
const lines = page.locator('#specify-region + div code > span')
expect(await lines.count()).toBe(3)
expect(await lines.count()).toBe(6)
})

test('with other features', async () => {
const div = page.locator('#with-other-features + div')
expect(await getClassList(div)).toContain('line-numbers-mode')
const lines = div.locator('code > span')
expect(await lines.count()).toBe(3)
expect(await lines.count()).toBe(6)
expect(await getClassList(lines.nth(0))).toContain('highlighted')
})
})
Expand Down Expand Up @@ -216,10 +216,10 @@ describe('Code Groups', () => {

// blocks
const blocks = div.locator('.blocks > div')
expect(await blocks.nth(0).locator('code > span').count()).toBe(11)
expect(await blocks.nth(0).locator('code > span').count()).toBe(22)
expect(await getClassList(blocks.nth(1))).toContain('line-numbers-mode')
expect(await getClassList(blocks.nth(1))).toContain('language-ts')
expect(await blocks.nth(1).locator('code > span').count()).toBe(3)
expect(await blocks.nth(1).locator('code > span').count()).toBe(6)
expect(
await getClassList(blocks.nth(1).locator('code > span').nth(0))
).toContain('highlighted')
Expand Down
4 changes: 2 additions & 2 deletions __tests__/init/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ test.each(variations)('init %s', async (_, { theme, useTs }) => {
expect(await page.textContent('h1')).toMatch('My Awesome Project')

await page.click('a[href="/markdown-examples.html"]')
await page.waitForSelector('pre code')
await page.waitForFunction('document.querySelector("pre code")')
expect(await page.textContent('h1')).toMatch('Markdown Extension Examples')

await goto('/')
expect(await page.textContent('h1')).toMatch('My Awesome Project')

await page.click('a[href="/api-examples.html"]')
await page.waitForSelector('pre code')
await page.waitForFunction('document.querySelector("pre code")')
expect(await page.textContent('h1')).toMatch('Runtime API Examples')

// teardown
Expand Down

0 comments on commit 9ae9487

Please sign in to comment.