fix(editor): Correct the expanded Markdown editor close label (#40041)

This commit is contained in:
Robin Braumann 2026-10-01 09:16:40 +00:00 committed by GitHub
parent 3a445ae2bf
commit ee46834915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View File

@ -255,14 +255,20 @@ describe('components/N8nMarkdownEditor', () => {
await waitFor(function waitForExpandedView() {
expect(wrapper.getByRole('dialog', { name: 'Markdown editor' })).toBeInTheDocument();
expect(wrapper.getByRole('button', { name: 'Collapse editor' })).toBeInTheDocument();
expect(wrapper.getByRole('button', { name: 'Close editor' })).toBeInTheDocument();
expect(wrapper.getByTestId('n8n-markdown-editor-content')).toHaveTextContent(
'Inline content',
);
});
const closeButton = wrapper.getByRole('button', { name: 'Close editor' });
closeButton.dispatchEvent(
new PointerEvent('pointermove', { bubbles: true, pointerType: 'mouse' }),
);
expect(await wrapper.findByTestId('tooltip-content')).toHaveTextContent('Close editor');
editor?.commands.insertContent(' expanded content');
await fireEvent.click(wrapper.getByRole('button', { name: 'Collapse editor' }));
await fireEvent.click(closeButton);
await waitFor(function waitForInlineView() {
expect(wrapper.queryByRole('dialog', { name: 'Markdown editor' })).not.toBeInTheDocument();
@ -311,7 +317,7 @@ describe('components/N8nMarkdownEditor', () => {
await waitFor(function waitForExpandedRawEditor() {
expect(wrapper.getByTestId('n8n-markdown-editor-raw-content')).toHaveValue('# Raw content');
});
await user.click(wrapper.getByRole('button', { name: 'Collapse editor' }));
await user.click(wrapper.getByRole('button', { name: 'Close editor' }));
await waitFor(function waitForInlineRawEditor() {
expect(wrapper.getByTestId('n8n-markdown-editor-raw-content')).toHaveValue('# Raw content');
@ -331,7 +337,7 @@ describe('components/N8nMarkdownEditor', () => {
await waitFor(function waitForExpandedView() {
expect(wrapper.getByRole('dialog', { name: 'Markdown editor' })).toBeInTheDocument();
expect(wrapper.getByRole('button', { name: 'Collapse editor' })).toBeInTheDocument();
expect(wrapper.getByRole('button', { name: 'Close editor' })).toBeInTheDocument();
});
});

View File

@ -262,7 +262,7 @@ export default {
'markdownEditor.expand': 'Expand editor',
'markdownEditor.collapse': 'Collapse editor',
'markdownEditor.openExpandedView': 'Expand editor',
'markdownEditor.closeExpandedView': 'Collapse editor',
'markdownEditor.closeExpandedView': 'Close editor',
'markdownEditor.expandedViewTitle': 'Markdown editor',
'markdownEditor.linkDialogTitle': 'Add link',
'markdownEditor.linkUrl': 'Link URL',