diff options
Diffstat (limited to 'spec/frontend/pipelines/blank_state_spec.js')
-rw-r--r-- | spec/frontend/pipelines/blank_state_spec.js | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/spec/frontend/pipelines/blank_state_spec.js b/spec/frontend/pipelines/blank_state_spec.js index c09d9232569..5dcf3d267ed 100644 --- a/spec/frontend/pipelines/blank_state_spec.js +++ b/spec/frontend/pipelines/blank_state_spec.js @@ -1,25 +1,20 @@ -import Vue from 'vue'; -import mountComponent from 'helpers/vue_mount_component_helper'; -import component from '~/pipelines/components/pipelines_list/blank_state.vue'; +import { getByText } from '@testing-library/dom'; +import { mount } from '@vue/test-utils'; +import BlankState from '~/pipelines/components/pipelines_list/blank_state.vue'; describe('Pipelines Blank State', () => { - let vm; - let Component; - - beforeEach(() => { - Component = Vue.extend(component); - - vm = mountComponent(Component, { + const wrapper = mount(BlankState, { + propsData: { svgPath: 'foo', message: 'Blank State', - }); + }, }); it('should render svg', () => { - expect(vm.$el.querySelector('.svg-content img').getAttribute('src')).toEqual('foo'); + expect(wrapper.find('.svg-content img').attributes('src')).toEqual('foo'); }); it('should render message', () => { - expect(vm.$el.querySelector('h4').textContent.trim()).toEqual('Blank State'); + expect(getByText(wrapper.element, /Blank State/i)).toBeTruthy(); }); }); |