Skip to content

Commit

Permalink
refactor: identical user api call
Browse files Browse the repository at this point in the history
  • Loading branch information
aman19K committed Sep 27, 2023
1 parent d8646de commit b49746e
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,11 @@ describe('export-to-csv with action users', () => {
.stub(mkdirp, 'sync', () => {})
.stub(process, 'chdir', () => {})
.nock(cma, (api) => {
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] });
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] }).persist();
})
.nock(cma, (api) => {
api.get(`/v3/organizations/${mockData.organizations[0].uid}/roles`).reply(200, { roles: mockData.roles });
})
.nock(cma, (api) => {
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] });
})
.nock(cma, (api) => {
api
.get(`/v3/organizations/${mockData.organizations[0].uid}/share?skip=0&page=1&limit=100`)
Expand All @@ -274,14 +271,11 @@ describe('export-to-csv with action users', () => {
api.get(`/v3/organizations?limit=100`).reply(200, { organizations: mockData.organizations });
})
.nock(cma, (api) => {
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] });
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] }).persist();
})
.nock(cma, (api) => {
api.get(`/v3/organizations/${mockData.organizations[0].uid}/roles`).reply(200, { roles: mockData.roles });
})
.nock(cma, (api) => {
api.get('/v3/user?include_orgs_roles=true').reply(200, { user: mockData.users[0] });
})
.nock(cma, (api) => {
api
.get(`/v3/organizations/${mockData.organizations[0].uid}/share?skip=0&page=1&limit=100`)
Expand Down

0 comments on commit b49746e

Please sign in to comment.