Commit 200538b7 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '209127-migrate-security-dashboard-tests-to-jest' into 'master'

Convert security dashboard component karma tests to jest

Closes #209127

See merge request gitlab-org/gitlab!27136
parents ae635516 5369f800
import Vue from 'vue';
import component from 'ee/security_dashboard/components/filters.vue';
import createStore from 'ee/security_dashboard/store';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { mountComponentWithStore } from 'helpers/vue_mount_component_helper';
describe('Filter component', () => {
let vm;
......
......@@ -2,7 +2,7 @@ import Vue from 'vue';
import component from 'ee/security_dashboard/components/vulnerability_action_buttons.vue';
import createStore from 'ee/security_dashboard/store';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { mountComponentWithStore } from 'helpers/vue_mount_component_helper';
import { resetStore } from '../helpers';
import mockDataVulnerabilities from '../store/vulnerabilities/data/mock_data_vulnerabilities';
......@@ -29,7 +29,7 @@ describe('Security Dashboard Action Buttons', () => {
canDismissVulnerability: true,
};
vm = mountComponentWithStore(Component, { store, props });
spyOn(vm.$store, 'dispatch').and.returnValue(Promise.resolve());
jest.spyOn(vm.$store, 'dispatch').mockReturnValue(Promise.resolve());
});
afterEach(() => {
......
......@@ -58,7 +58,7 @@ describe('Vulnerability Chart Buttons', () => {
});
it('should call the clickHandler', () => {
spyOn(wrapper.vm, 'clickHandler').and.stub();
jest.spyOn(wrapper.vm, 'clickHandler');
wrapper.find('[data-days="30"].active').trigger('click', DAYS.THIRTY);
expect(wrapper.vm.clickHandler).toHaveBeenCalledWith(DAYS.THIRTY);
......
import Vue from 'vue';
import component from 'ee/security_dashboard/components/vulnerability_count_list.vue';
import createStore from 'ee/security_dashboard/store';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { mountComponentWithStore } from 'helpers/vue_mount_component_helper';
import { resetStore } from '../helpers';
import mockData from '../store/vulnerabilities/data/mock_data_vulnerabilities_count.json';
......
import Vue from 'vue';
import component from 'ee/security_dashboard/components/vulnerability_count.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import mountComponent from 'helpers/vue_mount_component_helper';
describe('Vulnerability Count', () => {
const Component = Vue.extend(component);
......
import Vue from 'vue';
import component from 'ee/security_dashboard/components/vulnerability_issue_link.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import mountComponent from 'helpers/vue_mount_component_helper';
describe('Vulnerability Issue Link component', () => {
const Component = Vue.extend(component);
......
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