-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Expand file tree
/
Copy pathmarkdown-diff.e2e.spec.ts
More file actions
33 lines (25 loc) · 1.36 KB
/
Copy pathmarkdown-diff.e2e.spec.ts
File metadata and controls
33 lines (25 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { expect, test } from '@playwright/test';
test.describe('Tool - Markdown diff', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/markdown-diff');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Markdown diff - IT Tools', { timeout: 15000 });
});
test('Diff editor is visible with two editable panes', async ({ page }) => {
await expect(page.getByTestId('markdown-diff-editor')).toBeVisible();
await expect(page.locator('.monaco-diff-editor')).toBeVisible();
await expect(page.locator('.monaco-editor textarea.inputarea')).toHaveCount(2);
});
test('Preview mode shows rendered source and modified Markdown', async ({ page }) => {
await page.getByTestId('preview').click();
await expect(page.getByTestId('markdown-preview')).toBeVisible();
await expect(page.getByTestId('source-markdown-preview')).toBeVisible();
await expect(page.getByTestId('modified-markdown-preview')).toBeVisible();
await expect(page.getByTestId('source-markdown-preview').locator('table')).toBeVisible();
await expect(page.getByTestId('modified-markdown-preview')).toContainText('caching_sha2_password');
await page.getByTestId('code').click();
await expect(page.getByTestId('markdown-diff-editor')).toBeVisible();
await expect(page.locator('.monaco-diff-editor')).toBeVisible();
});
});