Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrans committed Sep 24, 2024
1 parent be435a8 commit 9fe15fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
5 changes: 0 additions & 5 deletions test/e2e/mock-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ async function setupMocking(
mobileActive: true,
extensionActive: true,
},
localhost: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
smartTransactions: {
mobileActive: false,
extensionActive: true,
Expand Down
25 changes: 11 additions & 14 deletions test/e2e/tests/smart-transactions/mock-requests-for-swap-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ const GET_TRANSACTION_BY_HASH_RESPONSE = {
export const mockSwapRequests = async (mockServer: MockttpServer) => {
await mockEthDaiTrade(mockServer);

await mockServer
.forJsonRpcRequest({
method: 'eth_getBalance',
params: ['0x5cfe73b6021e818b776b421b1c4db2474086a7e1'],
})
.thenJson(200, {
id: 3806592044086814,
jsonrpc: '2.0',
result: '0x1bc16d674ec80000', // 2 ETH
});

await mockServer
.forPost('https://transaction.api.cx.metamask.io/networks/1/getFees')
.withJsonBodyIncluding(GET_FEES_REQUEST_INCLUDES)
Expand All @@ -315,26 +326,13 @@ export const mockSwapRequests = async (mockServer: MockttpServer) => {
.once()
.thenJson(200, GET_BATCH_STATUS_RESPONSE_SUCCESS);

await mockServer
.forJsonRpcRequest({
method: 'eth_getBalance',
params: ['0x5cfe73b6021e818b776b421b1c4db2474086a7e1'],
})
// .once()
.thenJson(200, {
id: 3806592044086814,
jsonrpc: '2.0',
result: '0x1bc16d674ec80000', // 2 ETH
});

await mockServer
.forJsonRpcRequest({
method: 'eth_getTransactionReceipt',
params: [
'0xec9d6214684d6dc191133ae4a7ec97db3e521fff9cfe5c4f48a84cb6c93a5fa5',
],
})
// .once()
.thenJson(200, GET_TRANSACTION_RECEIPT_RESPONSE);

await mockServer
Expand All @@ -344,6 +342,5 @@ export const mockSwapRequests = async (mockServer: MockttpServer) => {
'0xec9d6214684d6dc191133ae4a7ec97db3e521fff9cfe5c4f48a84cb6c93a5fa5',
],
})
// .once()
.thenJson(200, GET_TRANSACTION_BY_HASH_RESPONSE);
};
4 changes: 0 additions & 4 deletions test/e2e/tests/swaps/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ export const reviewQuote = async (
'[data-testid="exchange-rate-display-quote-rate"]',
);
const summaryText = await summary.getText();
console.log('============\nsummaryText\n============', {
summaryText,
options,
});
assert.equal(summaryText.includes(options.swapFrom), true);
assert.equal(summaryText.includes(options.swapTo), true);
const quote = summaryText.split(`\n`);
Expand Down

0 comments on commit 9fe15fe

Please sign in to comment.