Commit 53faa4aa authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt Committed by Dheeraj Joshi

Render markup in DAST profiles library errors

parent 268cccb0
......@@ -5,6 +5,7 @@ import {
GlModal,
GlSkeletonLoader,
GlTable,
GlSafeHtmlDirective,
GlTooltipDirective,
GlDropdown,
GlDropdownItem,
......@@ -26,6 +27,7 @@ export default {
GlIcon,
},
directives: {
SafeHtml: GlSafeHtmlDirective,
GlTooltip: GlTooltipDirective,
},
props: {
......@@ -164,7 +166,11 @@ export default {
:aria-label="__('DastProfiles|Error Details')"
class="gl-p-0 gl-m-0"
>
<li v-for="errorDetail in errorDetails" :key="errorDetail">{{ errorDetail }}</li>
<li
v-for="errorDetail in errorDetails"
:key="errorDetail"
v-safe-html="errorDetail"
></li>
</ul>
</gl-alert>
</td>
......
......@@ -244,6 +244,17 @@ describe('EE - DastProfilesList', () => {
expect(within(getErrorDetails()).getByText(errorDetails[0])).not.toBe(null);
expect(within(getErrorDetails()).getByText(errorDetails[1])).not.toBe(null);
});
it('properly renders errors containing markup', () => {
const errorDetails = ['an error <a href="#">with a link</a>'];
createFullComponent({
propsData: { errorMessage: TEST_ERROR_MESSAGE, errorDetails },
});
expect(getErrorMessage()).not.toBe(null);
expect(getErrorDetails()).not.toBe(null);
expect(within(getErrorDetails()).getByRole('link', { name: 'with a link' })).not.toBe(null);
});
});
describe('profile referenced in a security policy', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment