Skip to content

Commit

Permalink
test: failing test for #300
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Oct 14, 2024
1 parent 24f1bee commit a155238
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions e2e/src/content/tutorial/tests/terminal/disabled/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
type: lesson
title: Disabled
terminal: false
mainCommand: 'node ./index.mjs'
previews:
- title: Example
port: 8000
---

# Terminal test - Disabled
12 changes: 12 additions & 0 deletions e2e/test/terminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ test('user can see terminal open by default', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Terminal', selected: true })).toBeVisible();
await expect(page.getByRole('tabpanel', { name: 'Terminal' })).toContainText('~/tutorial', { useInnerText: true });
});

test('user should not see "Toggle terminal" button when terminal is disabled', async ({ page }) => {
await page.goto(`${BASE_URL}/disabled`);

await expect(page.getByRole('heading', { level: 1, name: 'Terminal test - Disabled' })).toBeVisible();

// wait for webcontainer to boot by checking preview
const preview = page.frameLocator('[title="Example"]');
await expect(preview.getByText('Index page')).toBeVisible();

await expect(page.getByRole('button', { name: 'Toggle Terminal' })).not.toBeVisible();
});

0 comments on commit a155238

Please sign in to comment.