Skip to content

Commit f87b230

Browse files
test(onboarding): lose the canvas inside the preview, not during setup
`beginTour` awaits the renderer switch before `delay(INTRO_PREVIEW_MS)`, so flipping `linearMode` immediately after calling it changed the value while setup was still running rather than during the preview the test names. The test was already mutation-proof either way - removing the post-delay re-check fails it and nothing else - because no check sits between the setting write and the delay. But that is a property of today's code, not of the test, so a later check added there would have quietly made this pass for the wrong reason. Flushes setup with a zero-length tick first. Addresses #14673 (comment)
1 parent c27d65b commit f87b230

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/renderer/extensions/firstRunTour/tour/useFirstRunTourController.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ describe('useFirstRunTourController', () => {
374374
const controller = await freshController()
375375

376376
const starting = controller.beginTour('image_z_image_turbo')
377+
// Flush the renderer switch first, so the canvas is lost inside the
378+
// preview delay rather than while beginTour is still setting up. Only
379+
// the post-delay re-check can catch it from there.
380+
await vi.advanceTimersByTimeAsync(0)
377381
mocks.linearMode.value = true
378382
await vi.advanceTimersByTimeAsync(INTRO_PREVIEW_MS)
379383

0 commit comments

Comments
 (0)