mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
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:
@@ -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
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user