summaryrefslogtreecommitdiff
path: root/spec/javascripts/api_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/api_spec.js')
-rw-r--r--spec/javascripts/api_spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/javascripts/api_spec.js b/spec/javascripts/api_spec.js
index cf3a76d0d2e..5477581c1b9 100644
--- a/spec/javascripts/api_spec.js
+++ b/spec/javascripts/api_spec.js
@@ -137,6 +137,27 @@ describe('Api', () => {
done();
});
});
+
+ it('creates a group label', (done) => {
+ const namespace = 'group/subgroup';
+ const labelData = { some: 'data' };
+ const expectedUrl = `${dummyUrlRoot}/groups/${namespace}/-/labels`;
+ const expectedData = {
+ label: labelData,
+ };
+ mock.onPost(expectedUrl).reply((config) => {
+ expect(config.data).toBe(JSON.stringify(expectedData));
+
+ return [200, {
+ name: 'test',
+ }];
+ });
+
+ Api.newLabel(namespace, undefined, labelData, (response) => {
+ expect(response.name).toBe('test');
+ done();
+ });
+ });
});
describe('groupProjects', () => {