fix(client): preview button with screenreader text (#63061)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Anna
2026-04-13 06:57:29 -04:00
committed by GitHub
parent 02b12ac880
commit 6f059e8259
6 changed files with 87 additions and 27 deletions
+34
View File
@@ -28,6 +28,40 @@ test.describe('Desktop view', () => {
await expect(previewPortalButton).toBeVisible();
});
test('Preview button is visible during HTML/CSS/JS challenges', async ({
page
}) => {
const previewPaneButton = page.getByTestId('preview-pane-button');
const previewPortalButton = page.getByRole('button', {
name: translations.aria['move-preview-to-new-window']
});
expect(previewPortalButton).toBeDefined();
const hidePreviewText = translations.aria['hide-preview'];
const previewText = translations.learn['editor-tabs']['preview'];
await expect(previewPaneButton).toHaveText(hidePreviewText + previewText);
});
test('Terminal button is visible during Python challenges', async ({
page
}) => {
await page.goto('/learn/python-v9/workshop-caesar-cipher/step-1');
const terminalPaneButton = page.getByTestId('preview-pane-button');
const terminalPortalButton = page.getByRole('button', {
name: translations.aria['move-terminal-to-new-window']
});
const hideTerminalText = translations.aria['hide-terminal'];
const terminalText = translations.learn['editor-tabs']['terminal'];
await expect(terminalPaneButton).toHaveText(
hideTerminalText + terminalText
);
expect(terminalPortalButton).toBeDefined();
});
test('Clicking instructions button hides instructions panel, but not any buttons', async ({
page
}) => {