generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: command palette e2e tests (#3588)
Also adds a helper for pressing shortcut keys like `CMD+k`
- Loading branch information
1 parent
3a1193b
commit a98f447
Showing
3 changed files
with
38 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect, test } from '@playwright/test' | ||
import { pressShortcut } from './helpers' | ||
|
||
test('shows command palette results', async ({ page }) => { | ||
await page.goto('http://localhost:8892') | ||
|
||
await page.click('#command-palette-search') | ||
await page.fill('#command-palette-search-input', 'echo') | ||
|
||
// Command palette should be showing the echo parts | ||
await expect(page.locator('[role="listbox"]').getByText('echo.EchoRequest', { exact: true })).toBeVisible() | ||
await expect(page.locator('[role="listbox"]').getByText('echo.EchoResponse', { exact: true })).toBeVisible() | ||
await expect(page.locator('[role="listbox"]').getByText('echo.echo', { exact: true })).toBeVisible() | ||
}) | ||
|
||
test('opens command palette with keyboard shortcut', async ({ page }) => { | ||
await page.goto('http://localhost:8892') | ||
|
||
await pressShortcut(page, 'k') | ||
|
||
await expect(page.locator('#command-palette-search-input')).toBeVisible() | ||
await page.fill('#command-palette-search-input', 'echo') | ||
|
||
// Command palette should be showing the echo parts | ||
await expect(page.locator('[role="listbox"]').getByText('echo.EchoRequest', { exact: true })).toBeVisible() | ||
await expect(page.locator('[role="listbox"]').getByText('echo.EchoResponse', { exact: true })).toBeVisible() | ||
await expect(page.locator('[role="listbox"]').getByText('echo.echo', { exact: true })).toBeVisible() | ||
}) |
This file was deleted.
Oops, something went wrong.
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