mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 07:14:11 +00:00
- Remove 27 deprecated/wrapper methods from ComfyPage - Migrate callers to use helper classes directly: - keyboard.selectAll/bypass/undo/redo/moveUp/moveDown - clipboard.copy/paste - settings.setSetting/getSetting - workflow.loadWorkflow/deleteWorkflow/setupWorkflowsDirectory - contextMenu.clickMenuItem/clickLitegraphMenuItem - nodeOps.resizeNode with DefaultGraphPositions - canvasOps.clickEmptySpace with DefaultGraphPositions - Replace deprecated node click methods with direct canvas clicks - Replace position getter properties with DefaultGraphPositions imports Amp-Thread-ID: https://ampcode.com/threads/T-019c15e7-2319-76ec-855e-098ec75ef18a Co-authored-by: Amp <amp@ampcode.com>
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../../fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Integer Widget', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.setup()
|
|
})
|
|
|
|
test('should be disabled and not allow changing value when link connected to slot', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.workflow.loadWorkflow('vueNodes/linked-int-widget')
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
|
|
const seedWidget = comfyPage.vueNodes
|
|
.getWidgetByName('KSampler', 'seed')
|
|
.first()
|
|
const controls = comfyPage.vueNodes.getInputNumberControls(seedWidget)
|
|
const initialValue = Number(await controls.input.inputValue())
|
|
|
|
// Verify widget is disabled when linked
|
|
await controls.incrementButton.click({ force: true })
|
|
await expect(controls.input).toHaveValue(initialValue.toString())
|
|
|
|
await controls.decrementButton.click({ force: true })
|
|
await expect(controls.input).toHaveValue(initialValue.toString())
|
|
|
|
await expect(seedWidget).toBeVisible()
|
|
|
|
// Delete the node that is linked to the slot (freeing up the widget)
|
|
await comfyPage.vueNodes.getNodeByTitle('Int').click()
|
|
await comfyPage.vueNodes.deleteSelected()
|
|
|
|
// Test widget works when unlinked
|
|
await controls.incrementButton.click()
|
|
await expect(controls.input).toHaveValue((initialValue + 1).toString())
|
|
|
|
await controls.decrementButton.click()
|
|
await expect(controls.input).toHaveValue(initialValue.toString())
|
|
})
|
|
})
|