Skip to content

Commit

Permalink
test(e2e,playwright): side-panel.tsx (freeCodeCamp#52053)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLBlaze authored Oct 31, 2023
1 parent 86ae296 commit 0c53d75
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions e2e/side-panel.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';

test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables'
);
});

test.describe('Challenge Side Panel Component', () => {
test('should render correctly', async ({ page, isMobile }) => {
const toolPanelItem = page.getByText(translations.buttons['get-help']);
if (isMobile) {
await expect(toolPanelItem).not.toBeVisible();
} else {
await expect(toolPanelItem).toBeVisible();
}
await expect(page.getByTestId('challenge-title')).toBeVisible();
await expect(page.getByTestId('challenge-description')).toBeVisible();
await expect(page.getByTestId('test-result')).toBeVisible();
});
});

0 comments on commit 0c53d75

Please sign in to comment.