From 3b470c5d64a568900cd90014249337e04028e145 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:45:07 +0200 Subject: [PATCH] test(tags): make assertions safe for type-aware lint Assert tag pill props directly and await the rejected mutation assertion. Keep the same behavior coverage without unsafe inferred assignments. Both affected suites pass: 40 API tests and 38 document-tag tests. Full ESLint and remaining WIP validation gates still need to be rerun. --- web/app/components/editor/DocumentTagList.nuxt.test.ts | 9 +++------ web/app/composables/api/useTagAPI.nuxt.test.ts | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/web/app/components/editor/DocumentTagList.nuxt.test.ts b/web/app/components/editor/DocumentTagList.nuxt.test.ts index d69361a5..0583765a 100644 --- a/web/app/components/editor/DocumentTagList.nuxt.test.ts +++ b/web/app/components/editor/DocumentTagList.nuxt.test.ts @@ -211,12 +211,9 @@ describe("", { concurrent: false }, () => { expect(updateCalls).toHaveLength(1) expect(treeCalls).toHaveLength(2) expect(branchCalls).toHaveLength(1) - expect( - wrapper.findAllComponents(TagPill).map((pill) => ({ - name: pill.props("name"), - color: pill.props("color"), - })), - ).toEqual([{ name: "Live", color: "#f97316" }]) + expect(wrapper.findAllComponents(TagPill)).toHaveLength(1) + expect(wrapper.getComponent(TagPill).props("name")).toBe("Live") + expect(wrapper.getComponent(TagPill).props("color")).toBe("#f97316") }) it("refetches the branch's tags when the server says they changed", async ({ diff --git a/web/app/composables/api/useTagAPI.nuxt.test.ts b/web/app/composables/api/useTagAPI.nuxt.test.ts index 2ad83e43..0dce03bb 100644 --- a/web/app/composables/api/useTagAPI.nuxt.test.ts +++ b/web/app/composables/api/useTagAPI.nuxt.test.ts @@ -391,12 +391,11 @@ describe("useTagAPI", { concurrent: false }, () => { id: TAG_A, req: { tagName: "Live" }, }) - const rejected = expect(pending).rejects.toThrow() await put.reached expect(readTree()).toEqual([original]) put.reject(createError({ statusCode: 409 })) - await rejected + await expect(pending).rejects.toThrow() expect(put.calls).toHaveLength(1) expect(treeCalls).toHaveLength(0)