mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../../fixtures/ComfyPage'
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test.describe('Vue Node Selection', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
const modifiers = [
|
|
{ key: 'Control', name: 'ctrl' },
|
|
{ key: 'Shift', name: 'shift' },
|
|
{ key: 'Meta', name: 'meta' }
|
|
] as const
|
|
|
|
for (const { key: modifier, name } of modifiers) {
|
|
test(`should allow selecting multiple nodes with ${name}+click`, async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(1)
|
|
|
|
await comfyPage.page.getByText('Empty Latent Image').click({
|
|
modifiers: [modifier]
|
|
})
|
|
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(2)
|
|
|
|
await comfyPage.page.getByText('KSampler').click({
|
|
modifiers: [modifier]
|
|
})
|
|
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(3)
|
|
})
|
|
|
|
test(`should allow de-selecting nodes with ${name}+click`, async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(1)
|
|
|
|
await comfyPage.page.getByText('Load Checkpoint').click({
|
|
modifiers: [modifier]
|
|
})
|
|
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(0)
|
|
})
|
|
}
|
|
})
|