Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions e2e/playwright/boolean.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ test.describe('Point and click for boolean workflows', () => {

await editor.expectEditor.toContain(operation.code)
})

await test.step(`Delete ${operationName} operation via feature tree selection`, async () => {
await toolbar.openPane('feature-tree')
const ftOp = await toolbar.getFeatureTreeOperation(operationName, 0)
await ftOp.click({ button: 'left' })
await page.keyboard.press('Delete')
await scene.settled(cmdBar)
await toolbar.closePane('feature-tree')

// Expect changes in ft and code
await toolbar.openPane('code')
await editor.expectEditor.not.toContain(operation.code)
await expect(
await toolbar.getFeatureTreeOperation(operationName, 0)
).not.toBeVisible()
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this wasn't working well locally

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which line was failing? I'm guessing this one?

        await editor.expectEditor.not.toContain(operation.code)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just doesn't delete in the test, so weird. Working on it now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with right click -> Delete and that seems much better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is it possible that execution and population of the feature tree were taking longer than the test could allow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added scene.settled, should be better I think!

})
}
})
2 changes: 2 additions & 0 deletions src/lang/modifyAst/deleteFromSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export async function deleteFromSelection(
varDec.node.init.type === 'PipeExpression') ||
selection.artifact?.type === 'sweep' ||
selection.artifact?.type === 'plane' ||
selection.artifact?.type === 'compositeSolid' ||
selection.artifact?.type === 'helix' ||
!selection.artifact // aka expected to be a shell at this point
) {
Expand All @@ -170,6 +171,7 @@ export async function deleteFromSelection(
selection.artifact &&
selection.artifact.type !== 'sweep' &&
selection.artifact.type !== 'plane' &&
selection.artifact.type !== 'compositeSolid' &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Irev-Dev I just added to the existing codepath here for point and click var declarations 🤷

selection.artifact.type !== 'helix'
) {
const varDecName = varDec.node.id.name
Expand Down
Loading