diff --git a/apps/web/src/features/faucet/components/faucet-claim-all.test.tsx b/apps/web/src/features/faucet/components/faucet-claim-all.test.tsx new file mode 100644 index 0000000..b08b761 --- /dev/null +++ b/apps/web/src/features/faucet/components/faucet-claim-all.test.tsx @@ -0,0 +1,200 @@ +import { describe, it, expect, beforeEach, afterEach, vi } from "vitest" +import { render, screen, waitFor } from "@testing-library/react" +import userEvent from "@testing-library/user-event" +import { QueryClient, QueryClientProvider } from "@tanstack/react-query" +import { HttpResponse, http } from "msw" +import { Account, Networks, TransactionBuilder, nativeToScVal, rpc } from "@stellar/stellar-sdk" +import { toast } from "sonner" +import { useWalletStore } from "@/features/wallet/store/wallet-store" +import { walletKit } from "@/features/wallet/lib/wallet-kit" +import { server } from "@/test/msw/server" +import { fakeWalletAddress } from "@/test/fakes/wallet" +import { FaucetPage } from "./faucet-page" + +// ── Seed values ──────────────────────────────────────────────────────────────── +const CLAIM_AMOUNT_RAW = 10_000_000n +const BALANCE_RAW = 50_000_000n +const COOLDOWN_LEDGERS = 100 +const LAST_CLAIM_LEDGER = 0 + +// Precomputed base64-XDR constants: +// new SorobanDataBuilder().build().toXDR("base64") +const EMPTY_SOROBAN_DATA = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" +// xdr.ScVal.scvVoid().toXDR("base64") +const SCVAL_VOID = "AAAAAQ==" + +// ── UI-only mocks — useClaim and useFaucetData are left real ────────────────── +vi.mock("@/ui/Navbar", () => ({ Navbar: () =>