diff --git a/README.md b/README.md index 830ca77..7a69f02 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Installation Install using /admin/plugins OR -``git clone git@github.com:JohnMcLear/ep_file_menu_toolbar.git ep_aa_file_menu_toolbar`` +``git clone git@github.com:ether/ep_file_menu_toolbar.git`` ## TODO * i18n support diff --git a/eejs.js b/eejs.js index d3130a6..2baae59 100644 --- a/eejs.js +++ b/eejs.js @@ -4,7 +4,7 @@ const eejs = require('ep_etherpad-lite/node/eejs/'); exports.eejsBlock_styles = (hookName, args, cb) => { const css = eejs.require( - 'ep_aa_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.css', + 'ep_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.css', {}, module, ); args.content = `${args.content} @@ -13,7 +13,7 @@ exports.eejsBlock_styles = (hookName, args, cb) => { }; exports.eejsBlock_body = (hookName, args, cb) => { - args.content = eejs.require('ep_aa_file_menu_toolbar/templates/toolbar.ejs', { + args.content = eejs.require('ep_file_menu_toolbar/templates/toolbar.ejs', { settings: false, }) + args.content; cb(); diff --git a/static/js/index.js b/static/js/index.js index 625ea0c..79893fe 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -2,7 +2,7 @@ exports.documentReady = () => { /* eslint-disable-next-line max-len */ - $.getScript('../static/plugins/ep_aa_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.js', () => { + $.getScript('../static/plugins/ep_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.js', () => { $(() => { $('.dropdown-menu').dropdown_menu({ open_delay: 50, // Delay on menu open diff --git a/static/tests/frontend-new/specs/bold.spec.ts b/static/tests/frontend-new/specs/bold.spec.ts index 3ef19d5..60c754a 100644 --- a/static/tests/frontend-new/specs/bold.spec.ts +++ b/static/tests/frontend-new/specs/bold.spec.ts @@ -16,14 +16,20 @@ test.describe('ep_file_menu_toolbar', () => { // Select all the text in the pad. await page.keyboard.press('ControlOrMeta+A'); + // The bold entry lives inside the collapsed "Format" submenu, which the + // jquery-css dropdown plugin only expands on hover. dispatchEvent fires + // the click straight on the element regardless of visibility, which is + // what we want — the test asserts the menu link's onclick handler runs + // $('.buttonicon-bold').click() and toggles bold, not the dropdown's + // hover choreography. const boldEntry = page.locator('.dropdown-menu #bold > a'); - await boldEntry.click(); + await boldEntry.dispatchEvent('click'); await expect(padBody.locator('div').first().locator('b')).toHaveCount(1); await expect(padBody.locator('div').first()).toHaveText('hello world'); // Re-select and click again to disable. await page.keyboard.press('ControlOrMeta+A'); - await boldEntry.click(); + await boldEntry.dispatchEvent('click'); await expect(padBody.locator('div').first().locator('b')).toHaveCount(0); await expect(padBody.locator('div').first()).toHaveText('hello world'); });