Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Oct 11, 2023
1 parent d5ac7e5 commit 9a4214b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/TokenListController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ describe('TokenListController', () => {
});
});

describe('executePoll', () => {
describe('_executePoll', () => {
it('should call fetchTokenListByChainId with the correct chainId', async () => {
nock(tokenService.TOKEN_END_POINT_API)
.get(`/tokens/${convertHexToDecimal(ChainId.sepolia)}`)
Expand Down Expand Up @@ -1326,7 +1326,7 @@ describe('TokenListController', () => {
expiredCacheExistingState.tokenList,
);

await controller.executePoll('sepolia');
await controller._executePoll('sepolia');
expect(fetchTokenListByChainIdSpy.mock.calls[0]).toStrictEqual(
expect.arrayContaining([ChainId.sepolia]),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/src/TokenListController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class TokenListController extends PollingController<
* @param networkClientId - The ID of the network client triggering the fetch.
* @returns A promise that resolves when this operation completes.
*/
async executePoll(networkClientId: string): Promise<void> {
async _executePoll(networkClientId: string): Promise<void> {
return this.fetchTokenList(networkClientId);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/gas-fee-controller/src/GasFeeController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ describe('GasFeeController', () => {
});
});
});
describe('executePoll', () => {
describe('_executePoll', () => {
it('should call determineGasFeeCalculations with a URL that contains the chain ID', async () => {
await setupGasFeeController({
getIsEIP1559Compatible: jest.fn().mockResolvedValue(false),
Expand Down Expand Up @@ -896,8 +896,8 @@ describe('GasFeeController', () => {
clientId: '99999',
});

await gasFeeController.executePoll('mainnet');
await gasFeeController.executePoll('sepolia');
await gasFeeController._executePoll('mainnet');
await gasFeeController._executePoll('sepolia');

expect(mockedDetermineGasFeeCalculations).toHaveBeenCalledWith(
expect.objectContaining({
Expand All @@ -918,7 +918,7 @@ describe('GasFeeController', () => {
});

describe('polling (by networkClientId)', () => {
it('should call determineGasFeeCalculations (via executePoll) with a URL that contains the chain ID after the interval passed via the constructor', async () => {
it('should call determineGasFeeCalculations (via _executePoll) with a URL that contains the chain ID after the interval passed via the constructor', async () => {
const pollingInterval = 10000;
await setupGasFeeController({
getIsEIP1559Compatible: jest.fn().mockResolvedValue(false),
Expand Down
2 changes: 1 addition & 1 deletion packages/gas-fee-controller/src/GasFeeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class GasFeeController extends PollingController<
}, this.intervalDelay);
}

async executePoll(networkClientId: string): Promise<void> {
async _executePoll(networkClientId: string): Promise<void> {
await this.#fetchGasFeeEstimateForNetworkClientId(networkClientId);
}

Expand Down

0 comments on commit 9a4214b

Please sign in to comment.