Commit 1a50abff authored by jboyson's avatar jboyson

Replace mountComponent with mount

parent 5e900d3e
import Vue from 'vue'; import { mount } from '@vue/test-utils';
import mountComponent from 'helpers/vue_mount_component_helper'; import { getByText } from '@testing-library/dom';
import component from '~/pipelines/components/pipelines_list/blank_state.vue'; import BlankState from '~/pipelines/components/pipelines_list/blank_state.vue';
describe('Pipelines Blank State', () => { describe('Pipelines Blank State', () => {
let vm; const wrapper = mount(BlankState, {
let Component; propsData: {
beforeEach(() => {
Component = Vue.extend(component);
vm = mountComponent(Component, {
svgPath: 'foo', svgPath: 'foo',
message: 'Blank State', message: 'Blank State',
}); },
}); });
it('should render svg', () => { 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', () => { it('should render message', () => {
expect(vm.$el.querySelector('h4').textContent.trim()).toEqual('Blank State'); expect(getByText(wrapper.element, /Blank State/i)).toBeTruthy();
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment