fix: make identify call to pass missing user_id (#774)

This commit is contained in:
Shahbaz Shabbir
2023-03-10 18:05:02 +05:00
committed by GitHub
parent 294519c7a5
commit 93dcd8f16e
2 changed files with 9 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ jest.mock('@edx/frontend-platform/logging');
analytics.sendTrackEvent = jest.fn();
analytics.sendPageEvent = jest.fn();
analytics.identifyAuthenticatedUser = jest.fn();
logging.getLoggingService = jest.fn();
auth.configure = jest.fn();
@@ -127,6 +128,11 @@ describe('ProgressiveProfilingTests', () => {
expect(progressiveProfilingPage.find('#gender').exists()).toBeTruthy();
});
it('should make identify call to segment on progressive profiling page', async () => {
await getProgressiveProfilingPage();
expect(analytics.identifyAuthenticatedUser).toHaveBeenCalled();
});
it('should submit user profile details on form submission', async () => {
auth.getAuthenticatedUser = jest.fn(() => ({ userId: 3, username: 'abc123' }));
const formPayload = {