From b2f596f8c0f802ddd7d5c56c1db9d5301cda5022 Mon Sep 17 00:00:00 2001 From: Ranjeet2063 Date: Sun, 4 Oct 2026 16:53:17 +0545 Subject: [PATCH] feat(ux): add visible Coming Soon badges and roadmap tracking links for guardians and spend limits --- .../guardians/GuardianList.test.tsx | 35 +++++++++++++++++++ components/guardians/GuardianList.tsx | 24 ++++++++++--- components/policies/SpendLimitForm.tsx | 32 ++++++++++++----- 3 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 __tests__/components/guardians/GuardianList.test.tsx diff --git a/__tests__/components/guardians/GuardianList.test.tsx b/__tests__/components/guardians/GuardianList.test.tsx new file mode 100644 index 0000000..1483933 --- /dev/null +++ b/__tests__/components/guardians/GuardianList.test.tsx @@ -0,0 +1,35 @@ +/// +import { render, screen } from "@testing-library/react"; +import { test, expect, vi } from "vitest"; +import { GuardianList } from "@/components/guardians/GuardianList"; + +vi.mock("@/hooks/useWallet", () => ({ + useWallet: () => ({ + data: { + exists: true, + signers: [ + { credentialId: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", weight: 1 }, + ], + }, + isLoading: false, + }), +})); + +const WALLET = "C" + "B".repeat(55); + +test("renders GuardianList with visible Coming Soon badge and disabled action", () => { + render(); + expect(screen.getByText("Recovery Guardians")).toBeInTheDocument(); + expect(screen.getByText("Coming Soon")).toBeInTheDocument(); + + const button = screen.getByRole("button", { name: /Add Guardian/i }); + expect(button).toBeDisabled(); + expect(button).toHaveAttribute("title", "Guardian management ships with the next PolicyModule release"); +}); + +test("renders informative alert with link to roadmap and tracking issues", () => { + render(); + expect(screen.getByText(/Guardian add\/remove and recovery execution go through the PolicyModule/i)).toBeInTheDocument(); + const link = screen.getByRole("link", { name: /GitHub Tracking Issues/i }); + expect(link).toHaveAttribute("href", "https://github.com/Rayos-Org/web-dashboard/issues"); +}); diff --git a/components/guardians/GuardianList.tsx b/components/guardians/GuardianList.tsx index 59a4173..08d8d83 100644 --- a/components/guardians/GuardianList.tsx +++ b/components/guardians/GuardianList.tsx @@ -23,7 +23,12 @@ export function GuardianList({ walletAddress }: { walletAddress: string }) { return ( - Recovery Guardians +
+ Recovery Guardians + + Coming Soon + +
Trusted signers who can authorize wallet recovery — read live from your wallet contract.