diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 21:07:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 21:07:59 +0300 |
commit | 3ff3d897d6529aabb21aa6aed54eb430a9cf0fe2 (patch) | |
tree | d5aaf0b6766cd5d4118e8ccd57d1269d3e4d673e /spec/frontend/jobs | |
parent | 807c4eae46f96ccd54ce1d8d13f4547eda017267 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/jobs')
-rw-r--r-- | spec/frontend/jobs/components/log/log_spec.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/frontend/jobs/components/log/log_spec.js b/spec/frontend/jobs/components/log/log_spec.js index c933ed5c3e1..265f72ff344 100644 --- a/spec/frontend/jobs/components/log/log_spec.js +++ b/spec/frontend/jobs/components/log/log_spec.js @@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils'; import Vue from 'vue'; import Vuex from 'vuex'; import Log from '~/jobs/components/log/log.vue'; +import LogLineHeader from '~/jobs/components/log/line_header.vue'; import { logLinesParser } from '~/jobs/store/utils'; import { jobLog } from './mock_data'; @@ -10,6 +11,7 @@ describe('Job Log', () => { let actions; let state; let store; + let toggleCollapsibleLineMock; Vue.use(Vuex); @@ -20,8 +22,9 @@ describe('Job Log', () => { }; beforeEach(() => { + toggleCollapsibleLineMock = jest.fn(); actions = { - toggleCollapsibleLine: () => {}, + toggleCollapsibleLine: toggleCollapsibleLineMock, }; state = { @@ -37,11 +40,7 @@ describe('Job Log', () => { createComponent(); }); - afterEach(() => { - wrapper.destroy(); - }); - - const findCollapsibleLine = () => wrapper.find('.collapsible-line'); + const findCollapsibleLine = () => wrapper.findComponent(LogLineHeader); describe('line numbers', () => { it('renders a line number for each open line', () => { @@ -68,11 +67,9 @@ describe('Job Log', () => { describe('on click header section', () => { it('calls toggleCollapsibleLine', () => { - jest.spyOn(wrapper.vm, 'toggleCollapsibleLine'); - findCollapsibleLine().trigger('click'); - expect(wrapper.vm.toggleCollapsibleLine).toHaveBeenCalled(); + expect(toggleCollapsibleLineMock).toHaveBeenCalled(); }); }); }); |