Fix broken specs

Fixes specs that got broken after some close buttons got converted from
plain button elements to GlButton components in GitLab UI.
parent 3678def3
import { GlAlert, GlTable, GlEmptyState, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui';
import {
GlAlert,
GlTable,
GlEmptyState,
GlIntersectionObserver,
GlLoadingIcon,
GlButton,
} from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import FirstClassGroupVulnerabilities from 'ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue';
import VulnerabilityList from 'ee/security_dashboard/components/vulnerability_list.vue';
......@@ -74,7 +81,7 @@ describe('First Class Group Dashboard Vulnerabilities Component', () => {
it('should have an alert that is dismissable', () => {
const alert = findAlert();
alert.find('button').trigger('click');
alert.find(GlButton).vm.$emit('click');
return wrapper.vm.$nextTick(() => {
expect(alert.exists()).toBe(false);
});
......
import { GlAlert, GlTable, GlEmptyState, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui';
import {
GlAlert,
GlButton,
GlTable,
GlEmptyState,
GlIntersectionObserver,
GlLoadingIcon,
} from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import FirstClassInstanceVulnerabilities from 'ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue';
......@@ -93,7 +100,7 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => {
it('should have an alert that is dismissable', () => {
const alert = findAlert();
alert.find('button').trigger('click');
alert.find(GlButton).vm.$emit('click');
return wrapper.vm.$nextTick(() => {
expect(alert.exists()).toBe(false);
});
......
......@@ -6,10 +6,10 @@ exports[`NetworkPolicyList component renders policies table 1`] = `
<table
aria-busy="false"
aria-colcount="3"
aria-describedby="__BVID__333__caption_"
aria-describedby="__BVID__335__caption_"
aria-multiselectable="false"
class="table b-table gl-table table-hover b-table-stacked-md b-table-selectable b-table-select-single"
id="__BVID__333"
id="__BVID__335"
role="table"
>
<!---->
......
import { shallowMount } from '@vue/test-utils';
import { GlBanner } from '@gitlab/ui';
import { GlBanner, GlButton } from '@gitlab/ui';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
import { setCookie, parseBoolean } from '~/lib/utils/common_utils';
import InviteMembersBanner from '~/groups/components/invite_members_banner.vue';
......@@ -107,14 +107,12 @@ describe('InviteMembersBanner', () => {
});
describe('dismissing', () => {
const findButton = () => {
return wrapper.find('button');
};
const findButton = () => wrapper.findAll(GlButton).at(1);
beforeEach(() => {
wrapper = createComponent({ GlBanner });
findButton().trigger('click');
findButton().vm.$emit('click');
});
it('sets iDismissed to true', () => {
......
......@@ -19,7 +19,7 @@ describe('Submit Changes Error', () => {
});
};
const findRetryButton = () => wrapper.find(GlButton);
const findRetryButton = () => wrapper.findAll(GlButton).at(1);
const findAlert = () => wrapper.find(GlAlert);
beforeEach(() => {
......
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