ep_subscript_and_superscript 0.3.50 → 0.3.52

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ep_subscript_and_superscript
1
+ # Subscript and Superscript for Etherpad
2
2
 
3
3
  ![Demo](demo.gif)
4
4
 
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/ether/ep_subscript_and_superscript.git"
20
20
  },
21
- "version": "0.3.50",
21
+ "version": "0.3.52",
22
22
  "funding": {
23
23
  "type": "individual",
24
24
  "url": "https://etherpad.org/"
@@ -0,0 +1,28 @@
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_subscript_and_superscript', () => {
10
+ for (const [label, btnClass, spanClass] of [
11
+ ['superscript', 'buttonicon-superscript', 'sup'],
12
+ ['subscript', 'buttonicon-subscript', 'sub'],
13
+ ] as const) {
14
+ test(`Applies ${label} formatting`, async ({page}) => {
15
+ const padBody = await getPadBody(page);
16
+ await padBody.click();
17
+ await clearPadContent(page);
18
+ await writeToPad(page, 'First Line!');
19
+ await selectAllText(page);
20
+
21
+ await page.locator(`.${btnClass}`).click();
22
+
23
+ await expect(
24
+ padBody.locator('div').first().locator('span').first()
25
+ ).toHaveClass(new RegExp(`\\b${spanClass}\\b`));
26
+ });
27
+ }
28
+ });
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- describe('Set Superscript and subscript and ensure its removed properly', function () {
4
- // create a new pad before each test run
5
- beforeEach(function (cb) {
6
- helper.newPad(cb);
7
- this.timeout(60000);
8
- });
9
-
10
- it('When Superscript is changed', function (done) {
11
- this.timeout(60000);
12
- const chrome$ = helper.padChrome$;
13
- const inner$ = helper.padInner$;
14
-
15
- const $firstTextElement = inner$('div').first();
16
- $firstTextElement.sendkeys('First Line!');
17
- $firstTextElement.sendkeys('{selectall}');
18
-
19
- // sets first line to h1
20
- chrome$('.buttonicon-superscript').click();
21
- helper.waitFor(() => {
22
- const $firstSpan = inner$('div').first().find('span');
23
- return $firstSpan.hasClass('sup');
24
- }).done(() => {
25
- done();
26
- });
27
- });
28
-
29
- it('When Subscript is changed', function (done) {
30
- this.timeout(60000);
31
- const chrome$ = helper.padChrome$;
32
- const inner$ = helper.padInner$;
33
-
34
- const $firstTextElement = inner$('div').first();
35
- $firstTextElement.sendkeys('First Line!');
36
- $firstTextElement.sendkeys('{selectall}');
37
-
38
- // sets first line to h1
39
- chrome$('.buttonicon-subscript').click();
40
- helper.waitFor(() => {
41
- const $firstSpan = inner$('div').first().find('span');
42
- return $firstSpan.hasClass('sub');
43
- }).done(() => {
44
- done();
45
- });
46
- });
47
- });