Commit c63d6532 authored by Mark Florian's avatar Mark Florian Committed by Illya Klymov

Make all ProjectSelector props required

This addresses https://gitlab.com/gitlab-org/gitlab/-/issues/217987,
which is part of the larger [effort][1] to reduce duplication and
increase consistency in dashboards that use the ProjectSelector.

[1]: https://gitlab.com/groups/gitlab-org/-/epics/3330
parent acd2c7ad
......@@ -24,28 +24,23 @@ export default {
},
showNoResultsMessage: {
type: Boolean,
required: false,
default: false,
required: true,
},
showMinimumSearchQueryMessage: {
type: Boolean,
required: false,
default: false,
required: true,
},
showLoadingIndicator: {
type: Boolean,
required: false,
default: false,
required: true,
},
showSearchErrorMessage: {
type: Boolean,
required: false,
default: false,
required: true,
},
totalResults: {
type: Number,
required: false,
default: 0,
required: true,
},
},
data() {
......
import Vuex from 'vuex';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { merge } from 'lodash';
import createDefaultState from 'ee/security_dashboard/store/modules/project_selector/state';
......@@ -42,8 +43,7 @@ describe('Project Manager component', () => {
isUpdatingProjects: jest.fn().mockReturnValue(isUpdatingProjects),
},
state: {
...createDefaultState(),
...state,
...merge(createDefaultState(), state),
},
},
},
......@@ -155,11 +155,11 @@ describe('Project Manager component', () => {
});
it('passes the list of projects to the project-list component', () => {
const projects = [{}];
const projects = [{ foo: true }];
factory({ state: { projects } });
expect(getProjectList().props('projects')).toBe(projects);
expect(getProjectList().props('projects')).toEqual(projects);
});
it.each([false, true])(
......
......@@ -29,6 +29,7 @@ describe('ProjectSelector component', () => {
showMinimumSearchQueryMessage: false,
showLoadingIndicator: false,
showSearchErrorMessage: false,
totalResults: searchResults.length,
},
attachToDocument: 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