diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-11 18:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-11 18:08:32 +0300 |
commit | f1ce71c88c407709987dd4a7b40bdb7596b6baa2 (patch) | |
tree | 0d20ea80baaf8c11524584f586c2cc763af07cb2 /spec/frontend/api | |
parent | 28e90894e1e6f17320f5b1d2fff6fe736bf65dff (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/api')
-rw-r--r-- | spec/frontend/api/projects_api_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/api/projects_api_spec.js b/spec/frontend/api/projects_api_spec.js index 2d54d6173fd..4ceed885e6e 100644 --- a/spec/frontend/api/projects_api_spec.js +++ b/spec/frontend/api/projects_api_spec.js @@ -67,6 +67,20 @@ describe('~/api/projects_api.js', () => { }); }); + describe('createProject', () => { + it('posts to the correct URL and returns the data', () => { + const body = { name: 'test project' }; + const expectedUrl = '/api/v7/projects.json'; + const expectedRes = { id: 999, name: 'test project' }; + + mock.onPost(expectedUrl, body).replyOnce(HTTP_STATUS_OK, { data: expectedRes }); + + return projectsApi.createProject(body).then(({ data }) => { + expect(data).toStrictEqual(expectedRes); + }); + }); + }); + describe('importProjectMembers', () => { beforeEach(() => { jest.spyOn(axios, 'post'); |