mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
Backport of #6755 to `core/1.32` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6848-backport-core-1-32-feat-LOD-setting-for-LG-and-Vue-2b46d73d3650813d8105d5df3e3685e1) by [Unito](https://www.unito.io) Co-authored-by: Simula_r <18093452+simula-r@users.noreply.github.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../../fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Nodes Zoom', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.setSetting('LiteGraph.Canvas.MinFontSizeForLOD', 8)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should not capture drag while zooming with ctrl+shift+drag', async ({
|
|
comfyPage
|
|
}) => {
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const nodeBoundingBox = await checkpointNode.boundingBox()
|
|
if (!nodeBoundingBox) throw new Error('Node bounding box not available')
|
|
|
|
const nodeMidpointX = nodeBoundingBox.x + nodeBoundingBox.width / 2
|
|
const nodeMidpointY = nodeBoundingBox.y + nodeBoundingBox.height / 2
|
|
|
|
// Start the Ctrl+Shift drag-to-zoom on the canvas and continue dragging over
|
|
// the node. The node should not capture the drag while drag-zooming.
|
|
await comfyPage.page.keyboard.down('Control')
|
|
await comfyPage.page.keyboard.down('Shift')
|
|
await comfyPage.dragAndDrop(
|
|
{ x: 200, y: 300 },
|
|
{ x: nodeMidpointX, y: nodeMidpointY }
|
|
)
|
|
|
|
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-in-ctrl-shift.png')
|
|
})
|
|
})
|