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 { 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