-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unlink the enterprise learner in non blocking manner
- Loading branch information
1 parent
96970cf
commit a69d684
Showing
4 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { | |
fetchInProgressPathways, | ||
fetchLearnerProgramsList, | ||
postLinkEnterpriseLearner, | ||
postUnlinkUserFromEnterprise, | ||
updateUserActiveEnterprise, | ||
updateUserCsodParams, | ||
} from './enterpriseCustomerUser'; | ||
|
@@ -309,3 +310,22 @@ describe('fetchInProgressPathways', () => { | |
expect(response.status).toEqual(200); | ||
}); | ||
}); | ||
describe('postUnlinkUserFromEnterprise', () => { | ||
const mockEnterpriseCustomerUserUUID = 'test-enterprise-customer-user-uuid'; | ||
const mockUserEmail = '[email protected]'; | ||
const UNLINK_USER_ENDPOINT = `${APP_CONFIG.LMS_BASE_URL}/enterprise/api/v1/enterprise-customer/${mockEnterpriseCustomerUserUUID}/unlink_users/`; | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
axiosMock.reset(); | ||
}); | ||
|
||
it('passes correct POST body', async () => { | ||
axiosMock.onPost(UNLINK_USER_ENDPOINT).reply(200); | ||
await postUnlinkUserFromEnterprise(mockEnterpriseCustomerUserUUID, mockUserEmail); | ||
expect(axiosMock.history.post[0].data).toEqual(JSON.stringify({ | ||
user_emails: [mockUserEmail], | ||
is_relinkable: true, | ||
})); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters