Commit 7745bf3a authored by Illya Klymov's avatar Illya Klymov

Merge branch '217987-make-all-of-the-project-selector-vue-component-s-props-required' into 'master'

Make all of the project selector vue component's props required

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