Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const InstrumentSelector = () => {
{instruments.map((instrument) => (
<Command.Item
key={instrument.id}
keywords={[instrument.label]}
value={instrument.id}
onSelect={(id) => {
setSelectedInstrument(id);
Expand Down
6 changes: 2 additions & 4 deletions testing/src/pages/playground/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export class PlaygroundPage {
await this.$ref.goto(url);
}

/**
* Picks an example or template from the header's instrument list by its label. The list's search
* box matches on instrument ids rather than labels, so the option is clicked without filtering.
*/
/** Picks an example or template from the header's instrument list by its label. */
async selectInstrument(label: string): Promise<void> {
await this.$ref.getByRole('combobox', { name: 'Load an instrument...' }).click();
await this.$ref.getByPlaceholder('Search...').fill(label);
await this.$ref.getByRole('option', { exact: true, name: label }).click();
}
}
9 changes: 9 additions & 0 deletions testing/src/specs/playground.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ test.describe('playground', () => {
test.describe.configure({ mode: 'default' });
test.slow();

test('should find an instrument by its visible label in the selector', async ({ page }) => {
const playground = new PlaygroundPage(page);
await playground.goto();

await page.getByRole('combobox', { name: 'Load an instrument...' }).click();
await page.getByPlaceholder('Search...').fill('Form Reference');
await expect(page.getByRole('option', { exact: true, name: 'Form Reference' })).toBeVisible();
});

test('should run the preview on an origin other than the editor and render the instrument there @smoke', async ({
page
}) => {
Expand Down
Loading