ep_markdown 11.0.15 → 11.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -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
|
+
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
describe('Set formatting attributes and ensure ep_markdown displays properly', function () {
|
|
4
|
-
// create a new pad before each test run
|
|
5
|
-
beforeEach(async function () {
|
|
6
|
-
this.timeout(60000);
|
|
7
|
-
await helper.aNewPad();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('Bold section is shown as **foo** when clicking Show Markdown', async function () {
|
|
11
|
-
this.timeout(60000);
|
|
12
|
-
const chrome$ = helper.padChrome$;
|
|
13
|
-
const inner$ = helper.padInner$;
|
|
14
|
-
|
|
15
|
-
const $editorContents = inner$('div');
|
|
16
|
-
|
|
17
|
-
// clear pad
|
|
18
|
-
$editorContents.sendkeys('{selectall}');
|
|
19
|
-
inner$('div').first().sendkeys('bold');
|
|
20
|
-
inner$('div').first().sendkeys('{selectall}');
|
|
21
|
-
chrome$('.buttonicon-bold').click();
|
|
22
|
-
chrome$('#options-markdown').click();
|
|
23
|
-
|
|
24
|
-
await helper.waitForPromise(() => (inner$('div').first()[0].textContent === 'bold'));
|
|
25
|
-
|
|
26
|
-
const hasMarkdown = inner$('body').hasClass('markdown');
|
|
27
|
-
// TODO: Use a psuedo selector to ensure the value displayed to user is **bold**
|
|
28
|
-
expect(hasMarkdown).to.be(true);
|
|
29
|
-
});
|
|
30
|
-
});
|