Commit 759ad2d9 authored by Adam Alvis's avatar Adam Alvis

fixed failing tests

updated toEqual checks to toBe when comparing simple values
parent 771ce695
...@@ -31,15 +31,15 @@ describe('first class instance security dashboard empty state', () => { ...@@ -31,15 +31,15 @@ describe('first class instance security dashboard empty state', () => {
}); });
it('contains a GlEmptyState', () => { it('contains a GlEmptyState', () => {
expect(findGlEmptyState().exists()).toEqual(true); expect(findGlEmptyState().exists()).toBe(true);
}); });
it('contains a GlLink with href attribute equal to dashboardDocumentation', () => { it('contains a GlLink with href attribute equal to dashboardDocumentation', () => {
expect(findLink().attributes('href')).toEqual(dashboardDocumentation); expect(findLink().attributes('href')).toBe(dashboardDocumentation);
}); });
it('contains a GlButton', () => { it('contains a GlButton', () => {
expect(findButton().exists()).toEqual(true); expect(findButton().exists()).toBe(true);
}); });
it('emits `handleAddProjectsClick` on button click', async () => { it('emits `handleAddProjectsClick` on button click', async () => {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlEmptyState, GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import SecurityDashboardLayout from 'ee/security_dashboard/components/security_dashboard_layout.vue'; import SecurityDashboardLayout from 'ee/security_dashboard/components/security_dashboard_layout.vue';
import FirstClassInstanceDashboard from 'ee/security_dashboard/components/first_class_instance_security_dashboard.vue'; import FirstClassInstanceDashboard from 'ee/security_dashboard/components/first_class_instance_security_dashboard.vue';
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';
...@@ -8,6 +8,7 @@ import VulnerabilityChart from 'ee/security_dashboard/components/first_class_vul ...@@ -8,6 +8,7 @@ import VulnerabilityChart from 'ee/security_dashboard/components/first_class_vul
import CsvExportButton from 'ee/security_dashboard/components/csv_export_button.vue'; import CsvExportButton from 'ee/security_dashboard/components/csv_export_button.vue';
import Filters from 'ee/security_dashboard/components/first_class_vulnerability_filters.vue'; import Filters from 'ee/security_dashboard/components/first_class_vulnerability_filters.vue';
import ProjectManager from 'ee/security_dashboard/components/first_class_project_manager/project_manager.vue'; import ProjectManager from 'ee/security_dashboard/components/first_class_project_manager/project_manager.vue';
import EmptyState from 'ee/security_dashboard/components/empty_states/first_class_instance_security_dashboard.vue';
describe('First Class Instance Dashboard Component', () => { describe('First Class Instance Dashboard Component', () => {
let wrapper; let wrapper;
...@@ -24,7 +25,7 @@ describe('First Class Instance Dashboard Component', () => { ...@@ -24,7 +25,7 @@ describe('First Class Instance Dashboard Component', () => {
const findVulnerabilityChart = () => wrapper.find(VulnerabilityChart); const findVulnerabilityChart = () => wrapper.find(VulnerabilityChart);
const findCsvExportButton = () => wrapper.find(CsvExportButton); const findCsvExportButton = () => wrapper.find(CsvExportButton);
const findProjectManager = () => wrapper.find(ProjectManager); const findProjectManager = () => wrapper.find(ProjectManager);
const findEmptyState = () => wrapper.find(GlEmptyState); const findEmptyState = () => wrapper.find(EmptyState);
const findFilters = () => wrapper.find(Filters); const findFilters = () => wrapper.find(Filters);
const createWrapper = ({ data = {}, stubs }) => { const createWrapper = ({ data = {}, stubs }) => {
...@@ -102,7 +103,7 @@ describe('First Class Instance Dashboard Component', () => { ...@@ -102,7 +103,7 @@ describe('First Class Instance Dashboard Component', () => {
data: { data: {
isManipulatingProjects: false, isManipulatingProjects: false,
stubs: { stubs: {
GlEmptyState, EmptyState,
GlButton, GlButton,
}, },
}, },
...@@ -110,7 +111,10 @@ describe('First Class Instance Dashboard Component', () => { ...@@ -110,7 +111,10 @@ describe('First Class Instance Dashboard Component', () => {
}); });
it('renders the empty state', () => { it('renders the empty state', () => {
expect(findEmptyState().props('title')).toBe('Add a project to your dashboard'); expect(findEmptyState().props()).toEqual({
svgPath: emptyStateSvgPath,
dashboardDocumentation,
});
}); });
it('does not render the vulnerability list', () => { it('does not render the vulnerability list', () => {
......
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