Skip to content

Commit ea6d262

Browse files
committed
test: migrate frontend specs to Playwright (ether/etherpad#7622)
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
1 parent 076bba9 commit ea6d262

2 files changed

Lines changed: 35 additions & 30 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {expect, test} from '@playwright/test';
2+
import {clearPadContent, getPadBody, goToNewPad, selectAllText, writeToPad}
3+
from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper';
4+
5+
test.beforeEach(async ({page}) => {
6+
await goToNewPad(page);
7+
});
8+
9+
test.describe('ep_markdown', () => {
10+
test('Bold section renders the markdown class on body when "Show Markdown" is enabled',
11+
async ({page}) => {
12+
const padBody = await getPadBody(page);
13+
await padBody.click();
14+
await clearPadContent(page);
15+
await writeToPad(page, 'bold');
16+
await selectAllText(page);
17+
18+
// Apply bold via the toolbar button.
19+
await page.locator('.buttonicon-bold').click();
20+
21+
// Toggle "Show Markdown" in pad settings.
22+
// Settings popup must be open for #options-markdown to be clickable.
23+
await page.locator('.buttonicon-settings').click();
24+
await page.locator('#options-markdown').click({force: true});
25+
26+
// The pad body should gain the `markdown` class so its CSS swaps
27+
// <b> for visible **bold** rendering.
28+
await expect(padBody).toHaveClass(/markdown/);
29+
30+
// The original text content is unchanged (the rendering is purely
31+
// CSS-driven; the underlying text remains "bold" without the
32+
// surrounding asterisks in the document model).
33+
await expect(padBody.locator('div').first()).toHaveText('bold');
34+
});
35+
});

static/tests/frontend/specs/test.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)