diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/vue_shared/components/confirm_modal_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/vue_shared/components/confirm_modal_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/confirm_modal_spec.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/frontend/vue_shared/components/confirm_modal_spec.js b/spec/frontend/vue_shared/components/confirm_modal_spec.js index 8456ca9d125..96ccf56cbc6 100644 --- a/spec/frontend/vue_shared/components/confirm_modal_spec.js +++ b/spec/frontend/vue_shared/components/confirm_modal_spec.js @@ -62,7 +62,7 @@ describe('vue_shared/components/confirm_modal', () => { wrapper.vm.modalAttributes = MOCK_MODAL_DATA.modalAttributes; }); - it('renders GlModal wtih data', () => { + it('renders GlModal with data', () => { expect(findModal().exists()).toBeTruthy(); expect(findModal().attributes()).toEqual( expect.objectContaining({ @@ -72,6 +72,24 @@ describe('vue_shared/components/confirm_modal', () => { ); }); }); + + describe.each` + desc | attrs | expectation + ${'when message is simple text'} | ${{}} | ${`<div>${MOCK_MODAL_DATA.modalAttributes.message}</div>`} + ${'when message has html'} | ${{ messageHtml: '<p>Header</p><ul onhover="alert(1)"><li>First</li></ul>' }} | ${'<p>Header</p><ul><li>First</li></ul>'} + `('$desc', ({ attrs, expectation }) => { + beforeEach(() => { + createComponent(); + wrapper.vm.modalAttributes = { + ...MOCK_MODAL_DATA.modalAttributes, + ...attrs, + }; + }); + + it('renders message', () => { + expect(findForm().element.innerHTML).toContain(expectation); + }); + }); }); describe('methods', () => { |