feat: complete boolean task links and recompute closure

This commit is contained in:
2026-08-02 20:30:04 -04:00
parent f24ed40db8
commit 498e3f79ba
5 changed files with 57 additions and 11 deletions

View File

@@ -229,6 +229,9 @@ test('Sketcher solve command is selection-aware and emits the standard command l
facade.gui.command.execute({ commandId: 'solve-sketch' })
assert.deepEqual(events, ['command.started', 'command.completed'])
assert.equal(facade.app.document.getObject('sketch')?.sketch?.solver.status, 'solved')
facade.selection.select('pad')
assert.equal(facade.gui.command.getState('solve-sketch').status, 'disabled')
assert.match(facade.gui.command.getState('solve-sketch').reason || '', /Sketcher sketch/)
facade.selection.clear()
assert.equal(facade.gui.command.getState('solve-sketch').status, 'disabled')
})
@@ -770,6 +773,7 @@ test('Part Design feature tasks commit a document object and remain undoable', (
assert.equal(committed.objects.find((object) => object.id === 'pad001')?.properties.find((property) => property.name === 'Length')?.value, 55)
assert.equal(committed.objects.find((object) => object.id === 'pad001')?.properties.find((property) => property.name === 'Reversed')?.value, true)
assert.equal(committed.objects.find((object) => object.id === 'pad001')?.properties.find((property) => property.name === 'Midplane')?.value, true)
assert.ok(committed.recompute?.dirtyObjects.includes('pad001'))
facade.history.undo()
assert.equal(facade.app.document.getActive().tree.some((item) => item.id === 'pad001'), false)
@@ -806,9 +810,14 @@ test('Part workbench commands create primitive and boolean document objects', ()
assert.equal(facade.gui.command.getState('union').status, 'enabled')
facade.gui.command.execute({ commandId: 'union' })
facade.task.update({ base: 'box', tool: 'cylinder' })
facade.task.apply()
assert.equal(facade.app.document.getObject('union')?.typeId, 'Part::Fuse')
facade.app.document.setProperty({ objectId: 'union', propertyName: 'Base', value: 'box' })
facade.app.document.setProperty({ objectId: 'union', propertyName: 'Tool', value: 'cylinder' })
assert.equal(facade.app.document.getObject('union')?.properties.find((property) => property.name === 'Base')?.value, 'box')
assert.equal(facade.app.document.getObject('union')?.properties.find((property) => property.name === 'Tool')?.value, 'cylinder')
assert.deepEqual(facade.app.document.getDependencies().filter((edge) => edge.sourceId === 'union').map((edge) => edge.targetId).sort(), ['box', 'cylinder'])
facade.selection.select('origin')
assert.equal(facade.gui.command.getState('union').status, 'disabled')
assert.match(facade.gui.command.getState('union').reason || '', /solid or shape-producing/)
assert.equal(facade.gui.command.getState('check-shape').status, 'disabled')
})