Commit 1a50abff authored by jboyson's avatar jboyson

Replace mountComponent with mount

parent 5e900d3e
import Vue from 'vue';
import mountComponent from 'helpers/vue_mount_component_helper';
import component from '~/pipelines/components/pipelines_list/blank_state.vue';
import { mount } from '@vue/test-utils';
import { getByText } from '@testing-library/dom';
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();
});
});
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