Skip to content

Commit 79987db

Browse files
committed
test: Add test for SignatureScreen loading state when wallet is undefined
1 parent dc5fbe8 commit 79987db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ describe("SignatureScreen", () => {
101101
});
102102
});
103103

104-
it("shows loading state", async () => {
104+
it("shows loading state when wallet is undefined", async () => {
105+
// Override the mock to return undefined for this test
106+
vi.mocked(useActiveWallet).mockReturnValueOnce(undefined);
107+
105108
const { getByTestId } = render(
106109
<SignatureScreen
107110
onDone={() => {}}
@@ -113,10 +116,7 @@ describe("SignatureScreen", () => {
113116
{ setConnectedWallet: true },
114117
);
115118

116-
// Should show loading state
117-
await waitFor(() => {
118-
expect(getByTestId("loading-screen")).toBeInTheDocument();
119-
});
119+
expect(getByTestId("loading-screen")).toBeInTheDocument();
120120
});
121121

122122
it("handles error state", async () => {

0 commit comments

Comments
 (0)