Skip to content

Commit

Permalink
test: adjust for removal of getPreferencesState callback
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Jan 20, 2024
1 parent 92a4d8a commit db6974c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/assets-controllers/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},

Expand Down
24 changes: 14 additions & 10 deletions packages/assets-controllers/src/TokenDetectionController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,6 @@ describe('TokenDetectionController', () => {
addDetectedTokens: mockAddDetectedTokens,
disabled: false,
getBalancesInSingleCall: mockGetBalancesInSingleCall,
getPreferencesState: jest.fn().mockReturnValue({
...getDefaultPreferencesState(),
selectedAddress,
useTokenDetection: false,
}),
networkClientId: NetworkType.mainnet,
selectedAddress,
},
Expand All @@ -539,6 +534,13 @@ describe('TokenDetectionController', () => {
},
});

triggerPreferencesStateChange({
...getDefaultPreferencesState(),
selectedAddress,
useTokenDetection: false,
});
await advanceTime({ clock, duration: 1 });

triggerPreferencesStateChange({
...getDefaultPreferencesState(),
selectedAddress,
Expand Down Expand Up @@ -706,11 +708,6 @@ describe('TokenDetectionController', () => {
addDetectedTokens: mockAddDetectedTokens,
disabled: true,
getBalancesInSingleCall: mockGetBalancesInSingleCall,
getPreferencesState: jest.fn().mockReturnValue({
...getDefaultPreferencesState(),
selectedAddress,
useTokenDetection: false,
}),
networkClientId: NetworkType.mainnet,
selectedAddress,
},
Expand All @@ -731,6 +728,13 @@ describe('TokenDetectionController', () => {
},
});

triggerPreferencesStateChange({
...getDefaultPreferencesState(),
selectedAddress,
useTokenDetection: false,
});
await advanceTime({ clock, duration: 1 });

triggerPreferencesStateChange({
...getDefaultPreferencesState(),
selectedAddress,
Expand Down

0 comments on commit db6974c

Please sign in to comment.