feat: add document history transactions

This commit is contained in:
2026-08-02 03:00:59 -04:00
parent f20c83f21e
commit 52b7236803
4 changed files with 31 additions and 8 deletions

View File

@@ -59,3 +59,15 @@ test('command events carry a document-scoped request context', () => {
assert.ok(events.includes('command.completed'))
assert.match(requestId, /^req-/)
})
test('document mutations use the facade history boundary', () => {
const facade = createMockFacade()
facade.gui.command.execute({ commandId: 'new-document' })
assert.equal(facade.app.document.getActive().label, 'Untitled document')
assert.equal(facade.history.canUndo(), true)
facade.history.undo()
assert.equal(facade.app.document.getActive().label, 'Pump Housing')
assert.equal(facade.history.canRedo(), true)
facade.history.redo()
assert.equal(facade.app.document.getActive().label, 'Untitled document')
})