Fix broken specs

parent 8364f62a
import { import { GlAlert, GlTable, GlEmptyState, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui';
GlAlert,
GlTable,
GlEmptyState,
GlIntersectionObserver,
GlLoadingIcon,
GlButton,
} from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import FirstClassGroupVulnerabilities from 'ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue'; import FirstClassGroupVulnerabilities from 'ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue';
import VulnerabilityList from 'ee/security_dashboard/components/vulnerability_list.vue'; import VulnerabilityList from 'ee/security_dashboard/components/vulnerability_list.vue';
...@@ -81,7 +74,7 @@ describe('First Class Group Dashboard Vulnerabilities Component', () => { ...@@ -81,7 +74,7 @@ describe('First Class Group Dashboard Vulnerabilities Component', () => {
it('should have an alert that is dismissable', () => { it('should have an alert that is dismissable', () => {
const alert = findAlert(); const alert = findAlert();
alert.find(GlButton).vm.$emit('click'); alert.find('button').trigger('click');
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(alert.exists()).toBe(false); expect(alert.exists()).toBe(false);
}); });
......
import { import { GlAlert, GlTable, GlEmptyState, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui';
GlAlert,
GlButton,
GlTable,
GlEmptyState,
GlIntersectionObserver,
GlLoadingIcon,
} from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import FirstClassInstanceVulnerabilities from 'ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue'; import FirstClassInstanceVulnerabilities from 'ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue';
...@@ -100,7 +93,7 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => { ...@@ -100,7 +93,7 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => {
it('should have an alert that is dismissable', () => { it('should have an alert that is dismissable', () => {
const alert = findAlert(); const alert = findAlert();
alert.find(GlButton).vm.$emit('click'); alert.find('button').trigger('click');
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(alert.exists()).toBe(false); expect(alert.exists()).toBe(false);
}); });
......
...@@ -19,7 +19,7 @@ describe('Submit Changes Error', () => { ...@@ -19,7 +19,7 @@ describe('Submit Changes Error', () => {
}); });
}; };
const findRetryButton = () => wrapper.findAll(GlButton).at(1); const findRetryButton = () => wrapper.find(GlButton);
const findAlert = () => wrapper.find(GlAlert); const findAlert = () => wrapper.find(GlAlert);
beforeEach(() => { 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