mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 06:19:58 +00:00
## Summary Extend Vue node selection tests to also cover Meta key (Mac). ## Changes - **What**: Extended node selection test modifiers to include [Meta key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey) alongside existing Ctrl and Shift keys ## Review Focus Cross-platform keyboard modifier testing coverage and Mac-specific interaction patterns. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5824-test-extend-Vue-node-selection-browser-test-to-cover-Mac-Meta-key-27b6d73d365081778833cefb8592f158) by [Unito](https://www.unito.io)
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)
|
|
})
|
|
}
|
|
})
|