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/test_issue_body_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/test_issue_body_spec.js')
-rw-r--r-- | spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js b/spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js deleted file mode 100644 index 8a854a92ad7..00000000000 --- a/spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js +++ /dev/null @@ -1,96 +0,0 @@ -import { GlBadge, GlButton } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import Vue from 'vue'; -import Vuex from 'vuex'; -import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import IssueStatusIcon from '~/reports/components/issue_status_icon.vue'; -import TestIssueBody from '~/reports/grouped_test_report/components/test_issue_body.vue'; -import { failedIssue, successIssue } from '../../mock_data/mock_data'; - -Vue.use(Vuex); - -describe('Test issue body', () => { - let wrapper; - let store; - - const findDescription = () => wrapper.findByTestId('test-issue-body-description'); - const findStatusIcon = () => wrapper.findComponent(IssueStatusIcon); - const findBadge = () => wrapper.findComponent(GlBadge); - - const actionSpies = { - openModal: jest.fn(), - }; - - const createComponent = ({ issue = failedIssue } = {}) => { - store = new Vuex.Store({ - actions: actionSpies, - }); - - wrapper = extendedWrapper( - shallowMount(TestIssueBody, { - store, - propsData: { - issue, - }, - stubs: { - GlBadge, - GlButton, - IssueStatusIcon, - }, - }), - ); - }; - - afterEach(() => { - wrapper.destroy(); - }); - - describe('when issue has failed status', () => { - beforeEach(() => { - createComponent(); - }); - - it('renders issue name', () => { - expect(findDescription().text()).toContain(failedIssue.name); - }); - - it('renders failed status icon', () => { - expect(findStatusIcon().props('status')).toBe('failed'); - }); - - describe('when issue has recent failures', () => { - it('renders recent failures badge', () => { - expect(findBadge().exists()).toBe(true); - }); - }); - }); - - describe('when issue has success status', () => { - beforeEach(() => { - createComponent({ issue: successIssue }); - }); - - it('does not render recent failures', () => { - expect(findBadge().exists()).toBe(false); - }); - - it('renders issue name', () => { - expect(findDescription().text()).toBe(successIssue.name); - }); - - it('renders success status icon', () => { - expect(findStatusIcon().props('status')).toBe('success'); - }); - }); - - describe('when clicking on an issue', () => { - it('calls openModal action', () => { - createComponent(); - wrapper.findComponent(GlButton).trigger('click'); - - expect(actionSpies.openModal).toHaveBeenCalledWith(expect.any(Object), { - issue: failedIssue, - }); - }); - }); -}); |