Another one

This commit is contained in:
Pierre Jacquier
2025-02-14 13:55:41 -05:00
parent 433ec2d6cc
commit 3d5307264b

View File

@ -2045,50 +2045,47 @@ extrude001 = extrude(profile003, length = 5)
}) })
} }
) )
test('exit new sketch without drawing anything should not be a problem', async ({ test(
homePage, 'exit new sketch without drawing anything should not be a problem',
scene, { tag: '@skipWin' },
toolbar, async ({ homePage, scene, toolbar, editor, cmdBar, page }) => {
editor, await page.addInitScript(async () => {
cmdBar, localStorage.setItem('persistCode', `myVar = 5`)
page, })
}) => {
await page.addInitScript(async () => {
localStorage.setItem('persistCode', `myVar = 5`)
})
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
await expect( await expect(
page.getByRole('button', { name: 'Start Sketch' }) page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled() ).not.toBeDisabled()
const [selectXZPlane] = scene.makeMouseHelpers(650, 150) const [selectXZPlane] = scene.makeMouseHelpers(650, 150)
await toolbar.startSketchPlaneSelection() await toolbar.startSketchPlaneSelection()
await selectXZPlane() await selectXZPlane()
// timeout wait for engine animation is unavoidable // timeout wait for engine animation is unavoidable
await page.waitForTimeout(600) await page.waitForTimeout(600)
await editor.expectEditor.toContain(`sketch001 = startSketchOn('XZ')`) await editor.expectEditor.toContain(`sketch001 = startSketchOn('XZ')`)
await toolbar.exitSketchBtn.click() await toolbar.exitSketchBtn.click()
await editor.expectEditor.not.toContain(`sketch001 = startSketchOn('XZ')`) await editor.expectEditor.not.toContain(`sketch001 = startSketchOn('XZ')`)
await test.step("still renders code, hasn't got into a weird state", async () => { await test.step("still renders code, hasn't got into a weird state", async () => {
await editor.replaceCode( await editor.replaceCode(
'myVar = 5', 'myVar = 5',
`myVar = 5 `myVar = 5
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
profile001 = circle({ profile001 = circle({
center = [12.41, 3.87], center = [12.41, 3.87],
radius = myVar radius = myVar
}, sketch001)` }, sketch001)`
) )
await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15) await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15)
}) })
}) }
)
test( test(
'A sketch with only "startProfileAt" and no segments should still be able to be continued', 'A sketch with only "startProfileAt" and no segments should still be able to be continued',
{ tag: ['@skipWin'] }, { tag: ['@skipWin'] },