Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stacks js v6 mock broadcast tx for swaps #6099

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/mocks/mock-stacks-txs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ export async function mockStacksPendingTransaction(page: Page) {
);
}

export async function mockStacksBroadcastTransactionV6(page: Page) {
await page.route(`**/api.hiro.so/v2/transactions`, route =>
route.fulfill({
body: '9b709768122e6c62a37b087106cc9c23280ed6242b565484b6cc4e6a43ae1155',
})
);
}

export async function mockStacksBroadcastTransaction(page: Page) {
await page.route(`**/api.mainnet.hiro.so/v2/transactions`, route =>
route.fulfill({
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/swap/swap.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { mockStacksBroadcastTransaction } from '@tests/mocks/mock-stacks-txs';
import { mockStacksBroadcastTransactionV6 } from '@tests/mocks/mock-stacks-txs';

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

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

await globalPage.setupAndUseApiCalls(extensionId);
await mockStacksBroadcastTransaction(globalPage.page);
await mockStacksBroadcastTransactionV6(globalPage.page);
await onboardingPage.signInWithTestAccount(extensionId);
await homePage.swapButton.click();
await swapPage.waitForSwapPageReady();
Expand Down
Loading