diff --git a/js/components/__tests__/confirmation_popover.test.js b/js/components/__tests__/confirmation_popover.test.js index 72369e00..cf31b253 100644 --- a/js/components/__tests__/confirmation_popover.test.js +++ b/js/components/__tests__/confirmation_popover.test.js @@ -7,20 +7,26 @@ const localVue = createLocalVue() localVue.use(VTooltip) describe('ConfirmationPopover', () => { - it('matches snapshot', () => { - const wrapper = shallowMount(ConfirmationPopover, { - localVue, - propsData: { - action: '/some-url', - btn_text: 'Do something dangerous', - cancel_btn_text: 'Cancel', - confirm_btn_text: 'Confirm', - confirm_msg: 'Are you sure you want to do that?', - csrf_token: '42' - } - }) + const wrapper = shallowMount(ConfirmationPopover, { + localVue, + propsData: { + action: '/some-url', + btn_text: 'Do something dangerous', + cancel_btn_text: 'Cancel', + confirm_btn_text: 'Confirm', + confirm_msg: 'Are you sure you want to do that?', + csrf_token: '42' + } + }) + it('matches snapshot', () => { expect(wrapper).toMatchSnapshot() }) + + it('renders form with hidden csrf input', () => { + const input = wrapper.find('input[type=hidden]') + expect(input.exists()).toBe(true) + expect(input.attributes('value')).toBe('42') + }) })