mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
Add test to guard against break in undo / redo
This commit is contained in:
@@ -53,6 +53,29 @@ test.describe('Change Tracker', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('Can undo & redo user changes', async ({ comfyPage }) => {
|
||||
comfyPage.clickEmptySpace()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('undo-initial-state.png')
|
||||
|
||||
comfyPage.dragAndDrop(
|
||||
comfyPage.clipTextEncodeNode2OutputSlot,
|
||||
comfyPage.kSamplerTitlebar
|
||||
)
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('undo-step1.png')
|
||||
|
||||
comfyPage.ctrlZ()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('undo-step2.png')
|
||||
|
||||
comfyPage.dragAndDrop(
|
||||
comfyPage.clipTextEncodeNode1OutputSlot,
|
||||
comfyPage.kSamplerTitlebar
|
||||
)
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('undo-step3.png')
|
||||
|
||||
comfyPage.ctrlZ()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('undo-step4.png')
|
||||
})
|
||||
|
||||
test('Can group multiple change actions into a single transaction', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
|
||||
@@ -458,10 +458,20 @@ export class ComfyPage {
|
||||
get clipTextEncodeNode1InputSlot(): Position {
|
||||
return { x: 427, y: 198 }
|
||||
}
|
||||
get clipTextEncodeNode1OutputSlot(): Position {
|
||||
return { x: 828, y: 197 }
|
||||
}
|
||||
|
||||
get clipTextEncodeNode2InputSlot(): Position {
|
||||
return { x: 422, y: 402 }
|
||||
}
|
||||
get clipTextEncodeNode2OutputSlot(): Position {
|
||||
return { x: 828, y: 400 }
|
||||
}
|
||||
|
||||
get kSamplerTitlebar(): Position {
|
||||
return { x: 1058, y: 175 }
|
||||
}
|
||||
|
||||
// A point on input edge.
|
||||
get clipTextEncodeNode2InputLinkPath(): Position {
|
||||
|
||||
Reference in New Issue
Block a user