Skip to content

Commit 2562313

Browse files
committed
fix: stacks js v6 mock broadcast tx for swaps
1 parent cb53bf5 commit 2562313

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/mocks/mock-stacks-txs.ts

+8
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ export async function mockStacksPendingTransaction(page: Page) {
165165
);
166166
}
167167

168+
export async function mockStacksBroadcastTransactionV6(page: Page) {
169+
await page.route(`**/api.hiro.so/v2/transactions`, route =>
170+
route.fulfill({
171+
body: '9b709768122e6c62a37b087106cc9c23280ed6242b565484b6cc4e6a43ae1155',
172+
})
173+
);
174+
}
175+
168176
export async function mockStacksBroadcastTransaction(page: Page) {
169177
await page.route(`**/api.mainnet.hiro.so/v2/transactions`, route =>
170178
route.fulfill({

tests/specs/swap/swap.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import { mockStacksBroadcastTransaction } from '@tests/mocks/mock-stacks-txs';
2+
import { mockStacksBroadcastTransactionV6 } from '@tests/mocks/mock-stacks-txs';
33

44
import { test } from '../../fixtures/fixtures';
55

@@ -8,7 +8,7 @@ test.describe('Swaps', () => {
88
test.setTimeout(60_000);
99

1010
await globalPage.setupAndUseApiCalls(extensionId);
11-
await mockStacksBroadcastTransaction(globalPage.page);
11+
await mockStacksBroadcastTransactionV6(globalPage.page);
1212
await onboardingPage.signInWithTestAccount(extensionId);
1313
await homePage.swapButton.click();
1414
await swapPage.waitForSwapPageReady();

0 commit comments

Comments
 (0)