fix(m2-m3): data-testid on new-client+add-client btns; fix client subscriptions API response shape; update E2E specs
This commit is contained in:
@@ -55,7 +55,7 @@ export default function ClientDetailPage() {
|
||||
|
||||
const { data: subscriptions, isError: subsError } = useQuery<Subscription[]>({
|
||||
queryKey: ["client-subscriptions", id],
|
||||
queryFn: async () => { const r = await api.get<Subscription[]>(`/api/v1/clients/${id}/subscriptions`); return r.data; },
|
||||
queryFn: async () => { const r = await api.get<{ data: Subscription[] }>(`/api/v1/clients/${id}/subscriptions`); return (r.data as any).data ?? []; },
|
||||
enabled: activeTab === "subscriptions",
|
||||
});
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export default function ClientsPage() {
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={() => refetch()} variant="outline" size="sm"><RefreshCw size={14} className="mr-1" />Refresh</Button>
|
||||
<Button onClick={() => setShowAdd(true)} size="sm"><UserPlus size={14} className="mr-1" />Add Client</Button>
|
||||
<Button onClick={() => setShowAdd(true)} size="sm" data-testid="add-client-btn"><UserPlus size={14} className="mr-1" />Add Client</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ export default function DashboardPage() {
|
||||
<Database className="h-4 w-4" /> Seed Demo Data
|
||||
</Button>
|
||||
)}
|
||||
<Button size="sm" onClick={() => router.push("/clients")}>+ New Client</Button>
|
||||
<Button size="sm" data-testid="new-client-btn" onClick={() => router.push("/clients")}>+ New Client</Button>
|
||||
<Button size="sm" variant="secondary" onClick={() => router.push("/payments")}>+ Record Payment</Button>
|
||||
<Button size="sm" variant="secondary" onClick={() => router.push("/tickets")}>+ New Ticket</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user