feat: add workflow selection preservation logic and related tests

This commit is contained in:
mlogclub
2026-06-30 12:31:08 +08:00
parent d72079a580
commit 79f0c06790
6 changed files with 40 additions and 2 deletions
@@ -277,6 +277,21 @@ describe("workflow branch interaction helpers", () => {
},
}), false)
})
it("clears workflow selection only when clicking outside preserved regions", async () => {
const { shouldClearWorkflowSelectionOnPointerDown } = await loadModule()
assert.equal(shouldClearWorkflowSelectionOnPointerDown({
closest(selector) {
return selector === "[data-workflow-preserve-selection]" ? {} : null
},
}), false)
assert.equal(shouldClearWorkflowSelectionOnPointerDown({
closest() {
return null
},
}), true)
})
})
describe("workflow definition mutations", () => {