diff --git a/packages/assets-controllers/jest.config.js b/packages/assets-controllers/jest.config.js index a01442c1db5..0d6e2be3898 100644 --- a/packages/assets-controllers/jest.config.js +++ b/packages/assets-controllers/jest.config.js @@ -17,10 +17,10 @@ module.exports = merge(baseConfig, { // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { - branches: 88.36, + branches: 88.5, functions: 95.32, - lines: 96.82, - statements: 96.83, + lines: 96.76, + statements: 96.76, }, }, diff --git a/packages/assets-controllers/src/TokenDetectionController.test.ts b/packages/assets-controllers/src/TokenDetectionController.test.ts index 6b329565177..e875462af23 100644 --- a/packages/assets-controllers/src/TokenDetectionController.test.ts +++ b/packages/assets-controllers/src/TokenDetectionController.test.ts @@ -514,11 +514,6 @@ describe('TokenDetectionController', () => { addDetectedTokens: mockAddDetectedTokens, disabled: false, getBalancesInSingleCall: mockGetBalancesInSingleCall, - getPreferencesState: jest.fn().mockReturnValue({ - ...getDefaultPreferencesState(), - selectedAddress, - useTokenDetection: false, - }), networkClientId: NetworkType.mainnet, selectedAddress, }, @@ -539,6 +534,13 @@ describe('TokenDetectionController', () => { }, }); + triggerPreferencesStateChange({ + ...getDefaultPreferencesState(), + selectedAddress, + useTokenDetection: false, + }); + await advanceTime({ clock, duration: 1 }); + triggerPreferencesStateChange({ ...getDefaultPreferencesState(), selectedAddress, @@ -706,11 +708,6 @@ describe('TokenDetectionController', () => { addDetectedTokens: mockAddDetectedTokens, disabled: true, getBalancesInSingleCall: mockGetBalancesInSingleCall, - getPreferencesState: jest.fn().mockReturnValue({ - ...getDefaultPreferencesState(), - selectedAddress, - useTokenDetection: false, - }), networkClientId: NetworkType.mainnet, selectedAddress, }, @@ -731,6 +728,13 @@ describe('TokenDetectionController', () => { }, }); + triggerPreferencesStateChange({ + ...getDefaultPreferencesState(), + selectedAddress, + useTokenDetection: false, + }); + await advanceTime({ clock, duration: 1 }); + triggerPreferencesStateChange({ ...getDefaultPreferencesState(), selectedAddress,