Commit 0b895967 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Fix a bug where the displayNamespaceId

was not included in the request made to
enable a devoops adoption group

Changelog: fixed
EE: true
parent 224284bb
...@@ -38,6 +38,9 @@ export default { ...@@ -38,6 +38,9 @@ export default {
isGroup: { isGroup: {
default: false, default: false,
}, },
groupGid: {
default: null,
},
}, },
props: { props: {
groups: { groups: {
......
...@@ -8,7 +8,12 @@ import bulkEnableDevopsAdoptionNamespacesMutation from 'ee/analytics/devops_repo ...@@ -8,7 +8,12 @@ import bulkEnableDevopsAdoptionNamespacesMutation from 'ee/analytics/devops_repo
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { groupNodes, devopsAdoptionNamespaceData, genericDeleteErrorMessage } from '../mock_data'; import {
groupNodes,
groupGids,
devopsAdoptionNamespaceData,
genericDeleteErrorMessage,
} from '../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
Vue.use(VueApollo); Vue.use(VueApollo);
...@@ -123,16 +128,23 @@ describe('DevopsAdoptionAddDropdown', () => { ...@@ -123,16 +128,23 @@ describe('DevopsAdoptionAddDropdown', () => {
}); });
describe('on row click', () => { describe('on row click', () => {
describe('sucessful request', () => { describe.each`
level | groupGid
${'group'} | ${groupGids[0]}
${'admin'} | ${null}
`('$level level sucessful request', ({ groupGid }) => {
beforeEach(() => { beforeEach(() => {
createComponent({ props: { hasSubgroups: true, groups: groupNodes } }); createComponent({
props: { hasSubgroups: true, groups: groupNodes },
provide: { groupGid },
});
clickFirstRow(); clickFirstRow();
}); });
it('makes a request to enable the selected group', () => { it('makes a request to enable the selected group', () => {
expect(mutate).toHaveBeenCalledWith({ expect(mutate).toHaveBeenCalledWith({
displayNamespaceId: undefined, displayNamespaceId: groupGid,
namespaceIds: ['gid://gitlab/Group/1'], namespaceIds: ['gid://gitlab/Group/1'],
}); });
}); });
......
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