diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/frontend/ide/components/panes/collapsible_sidebar_spec.js | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/frontend/ide/components/panes/collapsible_sidebar_spec.js')
-rw-r--r-- | spec/frontend/ide/components/panes/collapsible_sidebar_spec.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/frontend/ide/components/panes/collapsible_sidebar_spec.js b/spec/frontend/ide/components/panes/collapsible_sidebar_spec.js index 1d38231a767..e92f843ae6e 100644 --- a/spec/frontend/ide/components/panes/collapsible_sidebar_spec.js +++ b/spec/frontend/ide/components/panes/collapsible_sidebar_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import Vue from 'vue'; +import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; import IdeSidebarNav from '~/ide/components/ide_sidebar_nav.vue'; import CollapsibleSidebar from '~/ide/components/panes/collapsible_sidebar.vue'; @@ -127,5 +127,29 @@ describe('ide/components/panes/collapsible_sidebar.vue', () => { }); }); }); + + describe('with initOpenView that does not exist', () => { + beforeEach(async () => { + createComponent({ extensionTabs, initOpenView: 'does-not-exist' }); + + await nextTick(); + }); + + it('nothing is dispatched', () => { + expect(store.dispatch).not.toHaveBeenCalled(); + }); + }); + + describe('with initOpenView that does exist', () => { + beforeEach(async () => { + createComponent({ extensionTabs, initOpenView: fakeView.name }); + + await nextTick(); + }); + + it('dispatches open with view on create', () => { + expect(store.dispatch).toHaveBeenCalledWith('rightPane/open', fakeView); + }); + }); }); }); |