test(e2e,playwright): notes (#52162)

pull/51972/head^2
Radi Totev 2023-11-01 09:31:56 +02:00 committed by GitHub
parent 73e3ffd79a
commit bc1d326155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

28
e2e/notes.spec.ts Normal file
View File

@ -0,0 +1,28 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const notesButtonLabel = translations.learn['editor-tabs'].notes;
test('User can see notes', async ({ page }) => {
const noteContent = 'This is a test note';
await page.route(
'**/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-30/page-data.json',
async route => {
const response = await route.fetch();
const json = await response.json();
json.result.data.challengeNode.challenge.notes = noteContent;
await route.fulfill({ response, json });
}
);
await page.goto(
'learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-30'
);
await page.getByRole('button', { name: notesButtonLabel }).click();
await expect(page.getByText(noteContent)).toBeVisible();
});