Skip to content

Commit

Permalink
Fix test and lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandberger committed Aug 8, 2024
1 parent b8d1fd8 commit cba4874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/Root/FFetch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
RTR_AT_EXPIRY_IF_UNKNOWN,
RTR_AT_TTL_FRACTION,
RTR_FLS_WARNING_TTL,
RTR_TIME_MARGIN_IN_MS,
} from './constants';

jest.mock('../../loginServices', () => ({
Expand Down Expand Up @@ -206,7 +207,7 @@ describe('FFetch class', () => {
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox) - ms(RTR_FLS_WARNING_TTL));

// FLS timeout
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox));
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox - RTR_TIME_MARGIN_IN_MS));
});

it('handles RTR data in the session', async () => {
Expand Down Expand Up @@ -379,7 +380,7 @@ describe('FFetch class', () => {
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox) - ms(RTR_FLS_WARNING_TTL));

// FLS timeout
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox));
expect(st).toHaveBeenCalledWith(expect.any(Function), (refreshTokenExpiration - whatTimeIsItMrFox - RTR_TIME_MARGIN_IN_MS));
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/Root/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ export const RTR_RT_EXPIRY_IF_UNKNOWN = '10m';
* To account for minor delays between events (such as cookie expiration and API calls),
* this is a small amount of time to wait so the proper order can be ensured if they happen simultaneously.
*/
export const RTR_TIME_MARGIN_IN_MS = 200;
export const RTR_TIME_MARGIN_IN_MS = 200;

0 comments on commit cba4874

Please sign in to comment.