Skip to content

Commit ab8bcc9

Browse files
jtydhr88christian-byrnegithub-actions
authored
[test] add test for shift + wheel to pan canvas (#4540)
Co-authored-by: bymyself <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 4bab7bc commit ab8bcc9

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

browser_tests/tests/interaction.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,41 @@ test.describe('Canvas Navigation', () => {
986986
})
987987
})
988988

989+
test('Shift + mouse wheel should pan canvas horizontally', async ({
990+
comfyPage
991+
}) => {
992+
await comfyPage.page.click('canvas')
993+
await comfyPage.nextFrame()
994+
995+
await expect(comfyPage.canvas).toHaveScreenshot('standard-initial.png')
996+
997+
await comfyPage.page.mouse.move(400, 300)
998+
999+
await comfyPage.page.keyboard.down('Shift')
1000+
await comfyPage.page.mouse.wheel(0, 120)
1001+
await comfyPage.page.keyboard.up('Shift')
1002+
await comfyPage.nextFrame()
1003+
await expect(comfyPage.canvas).toHaveScreenshot(
1004+
'standard-shift-wheel-pan-right.png'
1005+
)
1006+
1007+
await comfyPage.page.keyboard.down('Shift')
1008+
await comfyPage.page.mouse.wheel(0, -240)
1009+
await comfyPage.page.keyboard.up('Shift')
1010+
await comfyPage.nextFrame()
1011+
await expect(comfyPage.canvas).toHaveScreenshot(
1012+
'standard-shift-wheel-pan-left.png'
1013+
)
1014+
1015+
await comfyPage.page.keyboard.down('Shift')
1016+
await comfyPage.page.mouse.wheel(0, 120)
1017+
await comfyPage.page.keyboard.up('Shift')
1018+
await comfyPage.nextFrame()
1019+
await expect(comfyPage.canvas).toHaveScreenshot(
1020+
'standard-shift-wheel-pan-center.png'
1021+
)
1022+
})
1023+
9891024
test.describe('Edge Cases', () => {
9901025
test('Multiple modifier keys work correctly in legacy mode', async ({
9911026
comfyPage
97.1 KB
Loading
98.1 KB
Loading
97.1 KB
Loading
98.1 KB
Loading

0 commit comments

Comments
 (0)