Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pages/groups/new/components/app_spec.js')
-rw-r--r--spec/frontend/pages/groups/new/components/app_spec.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/frontend/pages/groups/new/components/app_spec.js b/spec/frontend/pages/groups/new/components/app_spec.js
new file mode 100644
index 00000000000..ab483316086
--- /dev/null
+++ b/spec/frontend/pages/groups/new/components/app_spec.js
@@ -0,0 +1,39 @@
+import { shallowMount } from '@vue/test-utils';
+import App from '~/pages/groups/new/components/app.vue';
+import NewNamespacePage from '~/vue_shared/new_namespace/new_namespace_page.vue';
+
+describe('App component', () => {
+ let wrapper;
+
+ const createComponent = (propsData = {}) => {
+ wrapper = shallowMount(App, { propsData });
+ };
+
+ const findNewNamespacePage = () => wrapper.findComponent(NewNamespacePage);
+
+ const findCreateGroupPanel = () =>
+ findNewNamespacePage()
+ .props('panels')
+ .find((panel) => panel.name === 'create-group-pane');
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ it('creates correct component for group creation', () => {
+ createComponent();
+
+ expect(findNewNamespacePage().props('initialBreadcrumb')).toBe('New group');
+ expect(findCreateGroupPanel().title).toBe('Create group');
+ });
+
+ it('creates correct component for subgroup creation', () => {
+ const props = { parentGroupName: 'parent', importExistingGroupPath: '/path' };
+
+ createComponent(props);
+
+ expect(findNewNamespacePage().props('initialBreadcrumb')).toBe('parent');
+ expect(findCreateGroupPanel().title).toBe('Create subgroup');
+ expect(findCreateGroupPanel().detailProps).toEqual(props);
+ });
+});