refactor(frontend,plugins): normalise les DTOs review backend et corrige le mock (#120)

- plugin.ts: normalizeReview() garantit issues/installable définis même si backend omet ces champs
- mock/index.ts: MockPluginGateway.uninstall() retourne removalOutcome pour cohérence avec le domaine
- domain/index.ts: PluginUninstallResult ajoute removalOutcome optionnel
- Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-01 19:12:16 +02:00
parent 5baf5821d4
commit a88307c5ff
4 changed files with 42 additions and 3 deletions

View File

@ -23,4 +23,28 @@ describe("TauriPluginGateway invoke payloads", () => {
},
});
});
it("normalizes backend review DTOs for the Plugins panel view-model", async () => {
invoke.mockResolvedValueOnce({
id: "dev.acme.gitgraph",
displayName: "Git Graph",
publisher: "Acme",
version: "1.2.3",
description: "Graph",
sourceKind: "archive",
sourceLabel: "/tmp/gitgraph.ideaplug",
contentHash: "abc",
trustLevel: "full",
contributionSummary: { topLevelMenus: 1, menuItems: 2, layouts: 3, mcpServers: 4 },
contributes: { menus: [], menuItems: [], layouts: [], mcpServers: [] },
});
const review = await new TauriPluginGateway().reviewPackage({
sourceKind: "archive",
path: "/tmp/gitgraph.ideaplug",
});
expect(review.issues).toEqual([]);
expect(review.installable).toBe(true);
});
});