From 8bc526920fff3982a1e1b6cfd4c81af14f063b59 Mon Sep 17 00:00:00 2001 From: Ivan Atanasov Date: Tue, 19 Nov 2024 16:01:53 +0100 Subject: [PATCH] use v-n8n-html to render html error message --- .../src/components/NodeExecutionErrorMessage.test.ts | 8 ++++---- .../src/components/NodeExecutionErrorMessage.vue | 12 ++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/editor-ui/src/components/NodeExecutionErrorMessage.test.ts b/packages/editor-ui/src/components/NodeExecutionErrorMessage.test.ts index be70c28d98b82..3bc51a18e9a34 100644 --- a/packages/editor-ui/src/components/NodeExecutionErrorMessage.test.ts +++ b/packages/editor-ui/src/components/NodeExecutionErrorMessage.test.ts @@ -60,23 +60,23 @@ describe('NodeExecutionErrorMessage', () => { }); it('sanitizes malicious script in error message', () => { - const { container } = renderComponent({ + const { getByTestId } = renderComponent({ props: { nodeName: 'Test Node', errorMessage: '', }, }); - expect(container.querySelector('img')).not.toBeInTheDocument(); + expect(getByTestId('sanitized-error-message')).toContainHTML(''); }); it('sanitizes malicious script in error message with nested tags', () => { - const { container } = renderComponent({ + const { getByTestId } = renderComponent({ props: { nodeName: 'Test Node', errorMessage: '
', }, }); - expect(container.querySelector('img')).not.toBeInTheDocument(); + expect(getByTestId('sanitized-error-message')).toContainHTML('
'); }); it('sanitizes malicious script in error message with script tag', () => { diff --git a/packages/editor-ui/src/components/NodeExecutionErrorMessage.vue b/packages/editor-ui/src/components/NodeExecutionErrorMessage.vue index b7dae53fa5b54..26db3153ec7e2 100644 --- a/packages/editor-ui/src/components/NodeExecutionErrorMessage.vue +++ b/packages/editor-ui/src/components/NodeExecutionErrorMessage.vue @@ -1,25 +1,17 @@