diff options
Diffstat (limited to 'spec/frontend/pipelines/graph/action_component_spec.js')
-rw-r--r-- | spec/frontend/pipelines/graph/action_component_spec.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/frontend/pipelines/graph/action_component_spec.js b/spec/frontend/pipelines/graph/action_component_spec.js index 43da6388efa..3c5938cfa1f 100644 --- a/spec/frontend/pipelines/graph/action_component_spec.js +++ b/spec/frontend/pipelines/graph/action_component_spec.js @@ -7,6 +7,7 @@ import ActionComponent from '~/pipelines/components/graph/action_component.vue'; describe('pipeline graph action component', () => { let wrapper; let mock; + const findButton = () => wrapper.find('button'); beforeEach(() => { mock = new MockAdapter(axios); @@ -44,15 +45,15 @@ describe('pipeline graph action component', () => { }); it('should render an svg', () => { - expect(wrapper.find('.ci-action-icon-wrapper')).toBeDefined(); - expect(wrapper.find('svg')).toBeDefined(); + expect(wrapper.find('.ci-action-icon-wrapper').exists()).toBe(true); + expect(wrapper.find('svg').exists()).toBe(true); }); describe('on click', () => { it('emits `pipelineActionRequestComplete` after a successful request', done => { jest.spyOn(wrapper.vm, '$emit'); - wrapper.find('button').trigger('click'); + findButton().trigger('click'); waitForPromises() .then(() => { @@ -63,7 +64,7 @@ describe('pipeline graph action component', () => { }); it('renders a loading icon while waiting for request', done => { - wrapper.find('button').trigger('click'); + findButton().trigger('click'); wrapper.vm.$nextTick(() => { expect(wrapper.find('.js-action-icon-loading').exists()).toBe(true); |