Commit 878a306a authored by Stan Hu's avatar Stan Hu

Merge branch '13257-fix-failing-master-jest-spec' into 'master'

Fix jest spec using old GlTab interface

See merge request gitlab-org/gitlab-ee!14987
parents a5521e40 698de628
...@@ -120,7 +120,6 @@ export default { ...@@ -120,7 +120,6 @@ export default {
v-for="listType in listTypes" v-for="listType in listTypes"
:key="listType.namespace" :key="listType.namespace"
:disabled="isTabDisabled(listType.namespace)" :disabled="isTabDisabled(listType.namespace)"
title-link-class="js-tab"
> >
<template v-slot:title> <template v-slot:title>
{{ listType.label }} {{ listType.label }}
......
...@@ -308,7 +308,7 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f ...@@ -308,7 +308,7 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f
const findJobFailedAlert = () => wrapper.find(DependencyListJobFailedAlert); const findJobFailedAlert = () => wrapper.find(DependencyListJobFailedAlert);
const findIncompleteListAlert = () => wrapper.find(DependencyListIncompleteAlert); const findIncompleteListAlert = () => wrapper.find(DependencyListIncompleteAlert);
const findDependenciesTables = () => wrapper.findAll(PaginatedDependenciesTable); const findDependenciesTables = () => wrapper.findAll(PaginatedDependenciesTable);
const findTabControls = () => wrapper.findAll('.js-tab'); const findTabControls = () => wrapper.findAll('.gl-tab-nav-item');
const findVulnerableTabControl = () => findTabControls().at(1); const findVulnerableTabControl = () => findTabControls().at(1);
const findVulnerableTabComponent = () => wrapper.findAll(GlTab).at(1); const findVulnerableTabComponent = () => wrapper.findAll(GlTab).at(1);
...@@ -426,6 +426,10 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f ...@@ -426,6 +426,10 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f
}); });
}); });
it('has enabled vulnerable tab', () => {
expect(findVulnerableTabComponent().classes('disabled')).toBe(false);
});
describe('given there are no vulnerable dependencies', () => { describe('given there are no vulnerable dependencies', () => {
beforeEach(() => { beforeEach(() => {
store.state[vulnerableNamespace].dependencies = []; store.state[vulnerableNamespace].dependencies = [];
...@@ -435,11 +439,7 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f ...@@ -435,11 +439,7 @@ describe('DependenciesApp component with dependencyListVulnerabilities feature f
}); });
it('disables the vulnerable tab', () => { it('disables the vulnerable tab', () => {
expect(findVulnerableTabComponent().props()).toEqual( expect(findVulnerableTabComponent().classes('disabled')).toBe(true);
expect.objectContaining({
disabled: true,
}),
);
}); });
}); });
}); });
......
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