Commit 23e700d5 authored by Justin Ho's avatar Justin Ho Committed by Dheeraj Joshi

Fix "Remove" button in Slack app integration

The data-method attribute was removed by our config of
DOMpurify since we are using v-safe-html. Since this
is trusted input (comes from our own code), we should
allow these attributes for Rails remote link functionality.

Changelog: fixed
parent c83308d7
......@@ -87,6 +87,7 @@ export default {
},
helpHtmlConfig: {
ADD_TAGS: ['use'], // to support icon SVGs
FORBID_ATTR: [], // This is trusted input so we can override the default config to allow data-* attributes
},
};
</script>
......
......@@ -278,6 +278,7 @@ describe('IntegrationForm', () => {
<svg class="gl-icon">
<use></use>
</svg>
<a data-confirm="Are you sure?" data-method="delete" href="/settings/slack"></a>
</div>
`);
......@@ -291,9 +292,14 @@ describe('IntegrationForm', () => {
});
const helpHtml = wrapper.findByTestId(mockTestId);
const helpLink = helpHtml.find('a');
expect(helpHtml.isVisible()).toBe(true);
expect(helpHtml.find('svg').isVisible()).toBe(true);
expect(helpLink.attributes()).toMatchObject({
'data-confirm': 'Are you sure?',
'data-method': 'delete',
});
});
});
});
......
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