Skip to content

Commit

Permalink
make zoom work better
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 19, 2024
1 parent f1d3191 commit f38c29e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions browser_tests/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,11 @@ export class ComfyPage {
await this.nextFrame()
}

async zoom(deltaY: number) {
async zoom(deltaY: number, steps: number = 1) {
await this.page.mouse.move(10, 10)
await this.page.mouse.wheel(0, deltaY)
for (let i = 0; i < steps; i++) {
await this.page.mouse.wheel(0, deltaY)
}
await this.nextFrame()
}

Expand Down
4 changes: 2 additions & 2 deletions browser_tests/interaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ test.describe('Canvas Interaction', () => {
})

test('Can zoom very far out', async ({ comfyPage }) => {
await comfyPage.zoom(1200)
await comfyPage.zoom(100, 12)
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-very-far-out.png')
await comfyPage.zoom(-1200)
await comfyPage.zoom(-100, 12)
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-back-in.png')
})

Expand Down

0 comments on commit f38c29e

Please sign in to comment.