Commit e481c00f authored by Simon Knox's avatar Simon Knox

Merge branch '284056-fix-vulnerabilities-is-undefined-error-on-vulnerability-list' into 'master'

Fix console-error on vulnerabilities report

See merge request gitlab-org/gitlab!56076
parents bea43e50 2cb97f9b
...@@ -65,6 +65,7 @@ export default { ...@@ -65,6 +65,7 @@ export default {
filters() { filters() {
// Clear out the existing vulnerabilities so that the skeleton loader is shown. // Clear out the existing vulnerabilities so that the skeleton loader is shown.
this.vulnerabilities = []; this.vulnerabilities = [];
this.pageInfo = {};
}, },
sort() { sort() {
// Clear out the existing vulnerabilities so that the skeleton loader is shown. // Clear out the existing vulnerabilities so that the skeleton loader is shown.
......
---
title: Fix console-error on vulnerabilities report
merge_request: 56076
author:
type: fixed
...@@ -142,6 +142,14 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => { ...@@ -142,6 +142,14 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => {
it('should render the observer component', () => { it('should render the observer component', () => {
expect(findIntersectionObserver().exists()).toBe(true); expect(findIntersectionObserver().exists()).toBe(true);
}); });
describe('when the filter is changed', () => {
it('it should not render the observer component', async () => {
await wrapper.setProps({ filters: {} });
expect(findIntersectionObserver().exists()).toBe(false);
});
});
}); });
describe('when the query is loading and there is another page', () => { describe('when the query is loading and there is another page', () => {
...@@ -171,8 +179,8 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => { ...@@ -171,8 +179,8 @@ describe('First Class Instance Dashboard Vulnerabilities Component', () => {
wrapper = createWrapper({ loading: true }); wrapper = createWrapper({ loading: true });
}); });
it('should show the initial loading state when the filter is changed', () => { it('should show the initial loading state when the filter is changed', async () => {
wrapper.setProps({ filter: {} }); await wrapper.setProps({ filter: {} });
expectLoadingState({ initial: true }); expectLoadingState({ initial: 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