Commit 3ea3d774 authored by Mike Greiling's avatar Mike Greiling

Prefer shallowMount in tests

parent c929133b
import { mount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import SurveyBanner from '~/serverless/survey_banner.vue'; import SurveyBanner from '~/serverless/survey_banner.vue';
import { GlBanner } from '@gitlab/ui'; import { GlBanner } from '@gitlab/ui';
...@@ -7,7 +7,7 @@ describe('Knative survey banner', () => { ...@@ -7,7 +7,7 @@ describe('Knative survey banner', () => {
let wrapper; let wrapper;
function mountBanner() { function mountBanner() {
wrapper = mount(SurveyBanner, { wrapper = shallowMount(SurveyBanner, {
propsData: { propsData: {
surveyUrl: 'http://somesurvey.com/', surveyUrl: 'http://somesurvey.com/',
}, },
...@@ -15,7 +15,8 @@ describe('Knative survey banner', () => { ...@@ -15,7 +15,8 @@ describe('Knative survey banner', () => {
} }
afterEach(() => { afterEach(() => {
if (wrapper) wrapper.destroy(); wrapper.destroy();
wrapper = null;
}); });
it('should render the banner when the cookie is absent', () => { it('should render the banner when the cookie is absent', () => {
......
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