A3: singular and plural counts in the Problems window

The summary and the per-file count tooltip pick one/other catalog
messages ("1 error", "3 errors") instead of the plural-free wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-31 14:55:15 +01:00
parent 765dbf71b7
commit af24899ac5
3 changed files with 35 additions and 7 deletions

View file

@ -211,7 +211,15 @@ describe("ProblemsToolWindow", () => {
items: [diag(4, "warning", "Unused variable"), { ...diag(1, "error", "Undefined method"), code: "E12" }],
});
await emit({ kind: "diagnosticsChanged", path: "a.php", items: [diag(0, "hint", "Could be final")] });
expect(wrapper.get("[data-test=problems-status]").text()).toBe("Errors: 1, warnings: 1, other: 1");
expect(wrapper.get("[data-test=problems-status]").text()).toBe("1 error, 1 warning, 1 other");
expect(wrapper.findAll(".problems__file-count").map((c) => c.attributes("title"))).toEqual(["1 problem", "2 problems"]);
await emit({
kind: "diagnosticsChanged",
path: "b.php",
items: [diag(0, "error", "One"), diag(1, "error", "Two")],
});
expect(wrapper.get("[data-test=problems-status]").text()).toBe("3 errors, 1 warning, 1 other");
await emit({ kind: "diagnosticsChanged", path: "b.php", items: [] });
const files = wrapper.findAll("[data-test=problems-file]").map((f) => f.text());
expect(files[0]).toContain("a.php");
expect(files[1]).toContain("Service.php");