ep_table_of_contents 0.3.135 → 0.3.136

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ep_table_of_contents",
3
- "version": "0.3.135",
3
+ "version": "0.3.136",
4
4
  "description": "View a table of contents for your pad",
5
5
  "author": {
6
6
  "name": "John McLear",
@@ -0,0 +1,27 @@
1
+ import {expect, test} from '@playwright/test';
2
+ import {goToNewPad} from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper';
3
+
4
+ test.beforeEach(async ({page}) => {
5
+ await goToNewPad(page);
6
+ });
7
+
8
+ test.describe('ep_table_of_contents', () => {
9
+ test('plugin is loaded and exposes itself in clientVars', async ({page}) => {
10
+ const enabled = await page.evaluate(
11
+ () => (window as any).clientVars?.plugins?.plugins?.ep_table_of_contents != null);
12
+ expect(enabled).toBe(true);
13
+ });
14
+
15
+ test('TOC sidebar element is rendered into the pad', async ({page}) => {
16
+ // The eejsBlock_editorContainerBox hook injects templates/toc.ejs
17
+ // (the #toc + #tocItems container) into the pad's editor box.
18
+ await expect(page.locator('#toc')).toBeAttached();
19
+ await expect(page.locator('#tocItems')).toBeAttached();
20
+ });
21
+
22
+ test('toolbar TOC toggle button is present', async ({page}) => {
23
+ // The eejsBlock_editbarMenuRight hook injects templates/barButton.ejs
24
+ // — the toolbar entry that toggles the TOC sidebar visibility.
25
+ await expect(page.locator('#ep_table_of_contents-a')).toBeAttached();
26
+ });
27
+ });