Skip to content

Commit

Permalink
add tests for tool specific section minitoc links (#39396)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsese authored Jul 20, 2023
1 parent fa24961 commit 4f182d0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/fixtures/content/get-started/liquid/tool-specific.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,20 @@ cli content

{% desktop %}
this is desktop content
{% enddesktop %}
{% enddesktop %}

{% webui %}

## Webui section

Webui section specific content

{% endwebui %}

{% desktop %}

## Desktop section

Desktop section specific content

{% enddesktop %}
14 changes: 14 additions & 0 deletions tests/rendering-fixtures/playwright-rendering.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ test.describe('tool picker', () => {
await expect(page.getByText('this is cli content')).not.toBeVisible()
await expect(page.getByText('this is desktop content')).not.toBeVisible()
await expect(page.getByText('this is webui content')).toBeVisible()

// Go to page again so that we start with the default webui content and can
// check the minitoc links
await page.goto('/get-started/liquid/tool-specific')
await expect(
page.getByTestId('minitoc').getByRole('link', { name: 'Webui section' }),
).toBeVisible()
await expect(
page.getByTestId('minitoc').getByRole('link', { name: 'Desktop section' }),
).not.toBeVisible()
await page.getByTestId('tool-picker').getByRole('link', { name: 'Web browser' }).click()
await expect(
page.getByTestId('minitoc').getByRole('link', { name: 'Desktop section' }),
).not.toBeVisible()
})

test('prefer default tool', async ({ page }) => {
Expand Down

0 comments on commit 4f182d0

Please sign in to comment.