fix: document apply ordering invariant; visible indeterminate checkbox + test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
2026-07-05 15:26:46 +07:00
co-authored by Claude Opus 4.8
parent 2f1f5311ad
commit e283e5f22a
3 changed files with 29 additions and 1 deletions
+22
View File
@@ -131,3 +131,25 @@ test("select-all header checkbox calls onToggleAllUpdates(true) when clicked whi
await user.click(screen.getByRole("checkbox", { name: /выбрать все.*updates/i }))
expect(onToggleAllUpdates).toHaveBeenCalledWith(true)
})
test("select-all header checkbox is indeterminate when only some update rows are selected", () => {
const csWithMultipleUpdates: ChangesetResponse = {
updates: [
{ key: "A www.example.com.", kind: "update", type: "A", name: "www.example.com.", desired: ["1.1.1.1"], actual: ["9.9.9.9"], readOnly: false },
{ key: "A api.example.com.", kind: "update", type: "A", name: "api.example.com.", desired: ["1.1.1.2"], actual: ["9.9.9.8"], readOnly: false },
{ key: "A cdn.example.com.", kind: "update", type: "A", name: "cdn.example.com.", desired: ["1.1.1.3"], actual: ["9.9.9.7"], readOnly: false },
],
prunes: [],
readOnly: [],
inSyncCount: 0,
}
renderDiff({
changeset: csWithMultipleUpdates,
// Partial selection: one of three keys — neither all nor none — is what
// must drive the header checkbox into the indeterminate ("mixed") state.
selectedUpdates: new Set(["A www.example.com."]),
})
const selectAll = screen.getByRole("checkbox", { name: /выбрать все.*updates/i })
expect(selectAll).toHaveAttribute("aria-checked", "mixed")
})