diff --git a/tests/unit/NetworkTest.js b/tests/unit/NetworkTest.js index 9a90a100769f..487a86f5e4cc 100644 --- a/tests/unit/NetworkTest.js +++ b/tests/unit/NetworkTest.js @@ -4,6 +4,7 @@ import CONST from '../../src/CONST'; import * as App from '../../src/libs/actions/App'; import OnyxUpdateManager from '../../src/libs/actions/OnyxUpdateManager'; import * as PersistedRequests from '../../src/libs/actions/PersistedRequests'; +import * as PersonalDetails from '../../src/libs/actions/PersonalDetails'; import * as Session from '../../src/libs/actions/Session'; import HttpUtils from '../../src/libs/HttpUtils'; import Log from '../../src/libs/Log'; @@ -137,7 +138,7 @@ describe('NetworkTests', () => { HttpUtils.xhr = jest.fn(); HttpUtils.xhr - // And mock the first call to OpenApp return with an expired session code + // And mock the first call to openPersonalDetails return with an expired session code .mockImplementationOnce(() => Promise.resolve({ jsonCode: CONST.JSON_CODE.NOT_AUTHENTICATED, @@ -168,17 +169,17 @@ describe('NetworkTests', () => { // And then make 3 API requests in quick succession with an expired authToken and handle the response // It doesn't matter which requests these are really as all the response is mocked we just want to see // that we get re-authenticated - App.openApp(); - App.openApp(); - App.openApp(); + PersonalDetails.openPersonalDetails(); + PersonalDetails.openPersonalDetails(); + PersonalDetails.openPersonalDetails(); return waitForBatchedUpdates(); }) .then(() => { // We should expect to see the three calls to OpenApp, but only one call to Authenticate. // And we should also see the reconnection callbacks triggered. - const callsToOpenApp = _.filter(HttpUtils.xhr.mock.calls, ([command]) => command === 'OpenApp'); + const callsToAReadCommand = _.filter(HttpUtils.xhr.mock.calls, ([command]) => command === 'OpenPersonalDetailsPage'); const callsToAuthenticate = _.filter(HttpUtils.xhr.mock.calls, ([command]) => command === 'Authenticate'); - expect(callsToOpenApp.length).toBe(3); + expect(callsToAReadCommand.length).toBe(3); expect(callsToAuthenticate.length).toBe(1); expect(reconnectionCallbacksSpy.mock.calls.length).toBe(3); });