Fix Toolbar flash bug (during sketchMode animation (#5564)

* fix toolbar flash during animation

* add regression test

* fmt

* test tweak

* fmt
This commit is contained in:
Kurt Hutten
2025-02-28 15:50:01 +11:00
committed by GitHub
parent a0924bcfa3
commit b1b00a9a22
4 changed files with 98 additions and 54 deletions

View File

@ -629,6 +629,39 @@ extrude001 = extrude(sketch001, length = 50)
)
})
})
test(`Toolbar doesn't show modeling tools during sketch plane selection animation`, async ({
page,
homePage,
toolbar,
}) => {
await test.step('Load an empty file', async () => {
await page.addInitScript(async () => {
localStorage.setItem('persistCode', '')
})
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
})
const toolBarMode = () =>
page.locator('[data-currentMode]').getAttribute('data-currentMode')
await test.step('Start sketch and select a plane', async () => {
await expect.poll(toolBarMode).toEqual('modeling')
// Click the start sketch button
await toolbar.startSketchPlaneSelection()
// Click on a default plane at position [700, 200]
await page.mouse.click(700, 200)
// Check that the modeling toolbar doesn't appear during the animation
// The animation typically takes around 500ms, so we'll check for a second
await expect.poll(toolBarMode, { timeout: 1000 }).not.toEqual('modeling')
// After animation completes, we should see the sketching toolbar
await expect.poll(toolBarMode).toEqual('sketching')
})
})
})
async function clickExportButton(page: Page) {