diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/frontend/reports/grouped_test_report/components/modal_spec.js | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/frontend/reports/grouped_test_report/components/modal_spec.js')
-rw-r--r-- | spec/frontend/reports/grouped_test_report/components/modal_spec.js | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/spec/frontend/reports/grouped_test_report/components/modal_spec.js b/spec/frontend/reports/grouped_test_report/components/modal_spec.js deleted file mode 100644 index e8564d2428d..00000000000 --- a/spec/frontend/reports/grouped_test_report/components/modal_spec.js +++ /dev/null @@ -1,68 +0,0 @@ -import { GlLink, GlSprintf } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import { extendedWrapper } from 'helpers/vue_test_utils_helper'; - -import ReportsModal from '~/reports/grouped_test_report/components/modal.vue'; -import state from '~/reports/grouped_test_report/store/state'; -import CodeBlock from '~/vue_shared/components/code_block.vue'; - -const StubbedGlModal = { template: '<div><slot></slot></div>', name: 'GlModal', props: ['title'] }; - -describe('Grouped Test Reports Modal', () => { - const modalDataStructure = state().modal.data; - const title = 'Test#sum when a is 1 and b is 2 returns summary'; - - // populate data - modalDataStructure.execution_time.value = 0.009411; - modalDataStructure.system_output.value = 'Failure/Error: is_expected.to eq(3)\n\n'; - modalDataStructure.filename.value = { - text: 'link', - path: '/file/path', - }; - - let wrapper; - - beforeEach(() => { - wrapper = extendedWrapper( - shallowMount(ReportsModal, { - propsData: { - title, - modalData: modalDataStructure, - visible: true, - }, - stubs: { GlModal: StubbedGlModal, GlSprintf }, - }), - ); - }); - - afterEach(() => { - wrapper.destroy(); - }); - - it('renders code block', () => { - expect(wrapper.findComponent(CodeBlock).props().code).toEqual( - modalDataStructure.system_output.value, - ); - }); - - it('renders link', () => { - const link = wrapper.findComponent(GlLink); - - expect(link.attributes().href).toEqual(modalDataStructure.filename.value.path); - - expect(link.text()).toEqual(modalDataStructure.filename.value.text); - }); - - it('renders seconds', () => { - expect(wrapper.text()).toContain(`${modalDataStructure.execution_time.value} s`); - }); - - it('render title', () => { - expect(wrapper.findComponent(StubbedGlModal).props().title).toEqual(title); - }); - - it('re-emits hide event', () => { - wrapper.findComponent(StubbedGlModal).vm.$emit('hide'); - expect(wrapper.emitted().hide).toEqual([[]]); - }); -}); |