@@ -6,6 +6,7 @@ import { TEST_CLIENT } from "../../../../../../test/src/test-clients.js";
66import { createWallet } from "../../../../../wallets/create-wallet.js" ;
77import type { ConnectLocale } from "../locale/types.js" ;
88import { SignatureScreen } from "./SignatureScreen.js" ;
9+ import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js" ;
910
1011const mockAuth = vi . hoisted ( ( ) => ( {
1112 doLogin : vi . fn ( ) . mockResolvedValue ( undefined ) ,
@@ -14,14 +15,12 @@ const mockAuth = vi.hoisted(() => ({
1415 isLoggedIn : vi . fn ( ) . mockResolvedValue ( true ) ,
1516} ) ) ;
1617
17- const wallet = createWallet ( "io.metamask" ) ;
18-
1918vi . mock ( "../../../../core/hooks/auth/useSiweAuth" , ( ) => ( {
2019 useSiweAuth : ( ) => mockAuth ,
2120} ) ) ;
2221
2322vi . mock ( "../../../../core/hooks/wallets/useActiveWallet" , ( ) => ( {
24- useActiveWallet : ( ) => wallet ,
23+ useActiveWallet : vi . fn ( ) . mockReturnValue ( createWallet ( "io.metamask" ) ) ,
2524} ) ) ;
2625
2726vi . mock ( "../../../../core/hooks/wallets/useActiveAccount" , ( ) => ( {
@@ -102,10 +101,9 @@ describe("SignatureScreen", () => {
102101 } ) ;
103102
104103 it ( "shows loading state when wallet is undefined" , async ( ) => {
105- // Override the mock to return undefined for this test
106104 vi . mocked ( useActiveWallet ) . mockReturnValueOnce ( undefined ) ;
107105
108- const { getByTestId } = render (
106+ const { queryByTestId } = render (
109107 < SignatureScreen
110108 onDone = { ( ) => { } }
111109 modalSize = "wide"
@@ -116,7 +114,7 @@ describe("SignatureScreen", () => {
116114 { setConnectedWallet : true } ,
117115 ) ;
118116
119- expect ( getByTestId ( "loading-screen ") ) . toBeInTheDocument ( ) ;
117+ expect ( queryByTestId ( "sign-in-button ") ) . not . toBeInTheDocument ( ) ;
120118 } ) ;
121119
122120 it ( "handles error state" , async ( ) => {
0 commit comments