-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(runtime): option for setting terminal open by default (#246)
- Loading branch information
1 parent
8fb3322
commit 5419038
Showing
10 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test/ui/src/content/tutorial/tests/terminal/default/content.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
type: lesson | ||
title: Default | ||
terminal: | ||
panels: terminal | ||
--- | ||
|
||
# Terminal test - Default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
type: chapter | ||
title: Terminal | ||
--- |
9 changes: 9 additions & 0 deletions
9
test/ui/src/content/tutorial/tests/terminal/open-by-default/content.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
type: lesson | ||
title: Open by default | ||
terminal: | ||
open: true | ||
panels: "terminal" | ||
--- | ||
|
||
# Terminal test - Open by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
const BASE_URL = '/tests/terminal'; | ||
|
||
test('user can open terminal', async ({ page }) => { | ||
await page.goto(`${BASE_URL}/default`); | ||
|
||
await expect(page.getByRole('heading', { level: 1, name: 'Terminal test - Default' })).toBeVisible(); | ||
|
||
const tab = page.getByRole('tab', { name: 'Terminal' }); | ||
const panel = page.getByRole('tabpanel', { name: 'Terminal' }); | ||
|
||
/* eslint-disable multiline-comment-style */ | ||
// TODO: Requires #245 | ||
// await expect(tab).not.toBeVisible(); | ||
// await expect(panel).not.toBeVisible(); | ||
|
||
await page.getByRole('button', { name: 'Toggle Terminal' }).click(); | ||
|
||
await expect(tab).toBeVisible(); | ||
await expect(panel).toBeVisible(); | ||
await expect(panel).toContainText('~/tutorial', { useInnerText: true }); | ||
}); | ||
|
||
test('user can see terminal open by default', async ({ page }) => { | ||
await page.goto(`${BASE_URL}/open-by-default`); | ||
|
||
await expect(page.getByRole('heading', { level: 1, name: 'Terminal test - Open by default' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('tab', { name: 'Terminal', selected: true })).toBeVisible(); | ||
await expect(page.getByRole('tabpanel', { name: 'Terminal' })).toContainText('~/tutorial', { useInnerText: true }); | ||
}); |