Skip to content

Commit dac973f

Browse files
committed
test: add self-custodial home screen test
1 parent db90d4c commit dac973f

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

__tests__/screens/home.spec.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,35 @@ describe("HomeScreen", () => {
336336

337337
await waitFor(() => expect(mockNavigate).toHaveBeenCalledWith("transactionHistory"))
338338
})
339+
340+
it("skips GraphQL queries when self-custodial is active", async () => {
341+
jest.doMock("@app/hooks/use-active-wallet", () => ({
342+
useActiveWallet: () => ({
343+
wallets: [
344+
{
345+
id: "btc-1",
346+
walletCurrency: "BTC",
347+
balance: { amount: 0, currency: "BTC", currencyCode: "BTC" },
348+
transactions: [],
349+
},
350+
{
351+
id: "usd-1",
352+
walletCurrency: "USD",
353+
balance: { amount: 0, currency: "USD", currencyCode: "USD" },
354+
transactions: [],
355+
},
356+
],
357+
status: "ready",
358+
accountType: "self-custodial",
359+
}),
360+
}))
361+
362+
render(
363+
<ContextForScreen>
364+
<HomeScreen />
365+
</ContextForScreen>,
366+
)
367+
368+
await act(async () => {})
369+
})
339370
})

app/screens/account-type-selection/account-type-selection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export const AccountTypeSelectionScreen: React.FC = () => {
4545
}
4646
navigation.navigate("login", {
4747
type: PhoneLoginInitiateType.Login,
48-
title: undefined,
49-
onboarding: undefined,
5048
})
5149
return
5250
}

0 commit comments

Comments
 (0)