+
+
+
+ {error &&
{error}
}
);
}
From 6438f18cacec68bfd29184337b1ef8655a500fe2 Mon Sep 17 00:00:00 2001
From: Zekbot001 <280472700+Zekbot001@users.noreply.github.com>
Date: Sun, 31 May 2026 20:51:30 +0200
Subject: [PATCH 2/2] fix(marketplace): declare vote action buttons
---
src/components/MarketplaceVoteButton.test.tsx | 10 ++++++++++
src/components/mcp/McpVoteButton.tsx | 2 ++
src/components/prompts/PromptVoteButton.tsx | 2 ++
src/components/skills/SkillVoteButton.tsx | 2 ++
4 files changed, 16 insertions(+)
diff --git a/src/components/MarketplaceVoteButton.test.tsx b/src/components/MarketplaceVoteButton.test.tsx
index d1bba568..980bc021 100644
--- a/src/components/MarketplaceVoteButton.test.tsx
+++ b/src/components/MarketplaceVoteButton.test.tsx
@@ -78,4 +78,14 @@ describe("marketplace vote errors", () => {
expect(await screen.findByRole("alert")).toHaveTextContent("Vote denied");
expect(screen.getByTitle("Upvote")).toBeEnabled();
});
+
+ it("shows a fallback error when a vote request fails at the network layer", async () => {
+ vi.mocked(fetch).mockRejectedValue(new Error("offline"));
+
+ render(forms[0].render());
+ await userEvent.click(screen.getByTitle("Upvote"));
+
+ expect(await screen.findByRole("alert")).toHaveTextContent("Failed to update vote");
+ expect(screen.getByTitle("Upvote")).toBeEnabled();
+ });
});
diff --git a/src/components/mcp/McpVoteButton.tsx b/src/components/mcp/McpVoteButton.tsx
index a2b4a698..8a7a8cfe 100644
--- a/src/components/mcp/McpVoteButton.tsx
+++ b/src/components/mcp/McpVoteButton.tsx
@@ -57,6 +57,7 @@ export function McpVoteButton({