Commit 963866fc authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'jdb/replace-mount-component-blank-state' into 'master'

Replace mountComponent with mount

See merge request gitlab-org/gitlab!52929
parents dc728147 1a50abff
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