feat: add Part primitive task selection

This commit is contained in:
2026-08-02 19:25:37 -04:00
parent 9e15a6b10d
commit 42e59ac068
3 changed files with 12 additions and 8 deletions

View File

@@ -791,14 +791,15 @@ test('Part workbench commands create primitive and boolean document objects', ()
facade.task.apply()
assert.equal(facade.app.document.getObject('box')?.typeId, 'Part::Box')
facade.gui.command.execute({ commandId: 'primitive' })
facade.task.update({ primitiveType: 'Cylinder' })
facade.task.apply()
assert.equal(facade.app.document.getObject('box001')?.typeId, 'Part::Box')
assert.equal(facade.app.document.getObject('cylinder')?.typeId, 'Part::Cylinder')
assert.equal(facade.gui.command.getState('union').status, 'enabled')
facade.gui.command.execute({ commandId: 'union' })
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: 'box001' })
assert.deepEqual(facade.app.document.getDependencies().filter((edge) => edge.sourceId === 'union').map((edge) => edge.targetId).sort(), ['box', 'box001'])
facade.app.document.setProperty({ objectId: 'union', propertyName: 'Tool', value: 'cylinder' })
assert.deepEqual(facade.app.document.getDependencies().filter((edge) => edge.sourceId === 'union').map((edge) => edge.targetId).sort(), ['box', 'cylinder'])
})