diff --git a/playwright/e2e/mobile.spec.ts b/playwright/e2e/mobile.spec.ts index 4e030421ef2..aed8f1b6cb6 100644 --- a/playwright/e2e/mobile.spec.ts +++ b/playwright/e2e/mobile.spec.ts @@ -23,3 +23,41 @@ test('Formatting help', async ({ editor }) => { await editor.formattingHelp.getByLabel('Close').click() await expect(editor.formattingHelp).not.toBeVisible() }) + +test.describe('Actions with their own menu in remaining actions', () => { + test.beforeEach(async ({ page }) => { + // Narrow enough to move link, attachment and emoji into the remaining actions + await page.setViewportSize({ width: 240, height: 640 }) + }) + + test('Insert emoji', async ({ editor }) => { + await editor.clickMenu('Remain', 'Insert emoji') + const picker = editor.el.getByRole('dialog', { name: 'Emoji picker' }) + await expect(picker).toBeVisible() + const search = picker.getByRole('textbox', { name: 'Search' }) + await search.fill('cat') + await expect(picker.getByLabel('🐱, cat')).toHaveClass( + /emoji-mart-emoji-selected/, + ) + await search.press('Enter') + await expect(editor.content).toContainText('🐱') + await expect(editor.content).not.toContainText('undefined') + }) + + test('Insert attachment', async ({ editor }) => { + await editor.clickMenu('Remain', 'Insert attachment') + await expect(editor.getMenuItem('Upload from computer')).toBeVisible() + await expect(editor.getMenuItem('Insert from Files')).toBeVisible() + }) + + test('Insert link', async ({ editor }) => { + await editor.getMenu('Remain').click() + // Insert link toggles with the link mark, so depending on the version of + // @nextcloud/vue it is rendered as a checkbox + await editor + .getMenuItem('Insert link') + .or(editor.el.getByRole('menuitemcheckbox', { name: 'Insert link' })) + .click() + await expect(editor.getMenuItem('Link to website')).toBeVisible() + }) +}) diff --git a/src/components/Menu/ActionList.vue b/src/components/Menu/ActionList.vue index e7820e60883..b17185309cd 100644 --- a/src/components/Menu/ActionList.vue +++ b/src/components/Menu/ActionList.vue @@ -22,7 +22,7 @@