diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/frontend/design_management/pages/design/index_spec.js | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/frontend/design_management/pages/design/index_spec.js')
-rw-r--r-- | spec/frontend/design_management/pages/design/index_spec.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/frontend/design_management/pages/design/index_spec.js b/spec/frontend/design_management/pages/design/index_spec.js index 55d0fabe402..17a299c5de1 100644 --- a/spec/frontend/design_management/pages/design/index_spec.js +++ b/spec/frontend/design_management/pages/design/index_spec.js @@ -91,7 +91,12 @@ describe('Design management design index page', () => { function createComponent( { loading = false } = {}, - { data = {}, intialRouteOptions = {}, provide = {} } = {}, + { + data = {}, + intialRouteOptions = {}, + provide = {}, + stubs = { ApolloMutation, DesignSidebar, DesignReplyForm }, + } = {}, ) { const $apollo = { queries: { @@ -109,11 +114,7 @@ describe('Design management design index page', () => { wrapper = shallowMount(DesignIndex, { propsData: { id: '1' }, mocks: { $apollo }, - stubs: { - ApolloMutation, - DesignSidebar, - DesignReplyForm, - }, + stubs, provide: { issueIid: '1', projectPath: 'project-path', @@ -139,7 +140,7 @@ describe('Design management design index page', () => { describe('when navigating to component', () => { it('applies fullscreen layout class', () => { jest.spyOn(utils, 'getPageLayoutElement').mockReturnValue(mockPageLayoutElement); - createComponent({ loading: true }); + createComponent({}, { stubs: {} }); expect(mockPageLayoutElement.classList.add).toHaveBeenCalledTimes(1); expect(mockPageLayoutElement.classList.add).toHaveBeenCalledWith( @@ -151,7 +152,7 @@ describe('Design management design index page', () => { describe('when navigating within the component', () => { it('`scale` prop of DesignPresentation component is 1', async () => { jest.spyOn(utils, 'getPageLayoutElement').mockReturnValue(mockPageLayoutElement); - createComponent({ loading: false }, { data: { design, scale: 2 } }); + createComponent({}, { data: { design, scale: 2 } }); await nextTick(); expect(findDesignPresentation().props('scale')).toBe(2); @@ -180,7 +181,8 @@ describe('Design management design index page', () => { it('sets loading state', () => { createComponent({ loading: true }); - expect(wrapper.element).toMatchSnapshot(); + expect(wrapper.find(DesignPresentation).props('isLoading')).toBe(true); + expect(wrapper.find(DesignSidebar).props('isLoading')).toBe(true); }); it('renders design index', () => { @@ -197,6 +199,7 @@ describe('Design management design index page', () => { design, markdownPreviewPath: '/project-path/preview_markdown?target_type=Issue', resolvedDiscussionsExpanded: false, + isLoading: false, }); }); |