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.
This commit is contained in:
FredApps 2026-10-10 16:45:07 +02:00
parent 5389be1d70
commit 3b470c5d64
2 changed files with 4 additions and 8 deletions

View File

@ -211,12 +211,9 @@ describe("<DocumentTagList>", { 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 ({

View File

@ -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)