mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
Fix copy paste of widget value (#284)
* Fix copy paste of widget value * Fix ui tests * Allow undefined group font size * Update test expectations [skip ci] * nit --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -38,8 +38,11 @@ describe('example workflows', () => {
|
||||
lg.teardown(global)
|
||||
})
|
||||
|
||||
for (const file of readdirSync(WORKFLOW_DIR)) {
|
||||
if (!file.endsWith('.json')) continue
|
||||
const workflowFiles = readdirSync(WORKFLOW_DIR).filter((file) =>
|
||||
file.endsWith('.json')
|
||||
)
|
||||
|
||||
const workflows = workflowFiles.map((file) => {
|
||||
const { workflow, prompt } = JSON.parse(
|
||||
readFileSync(path.resolve(WORKFLOW_DIR, file), 'utf8')
|
||||
)
|
||||
@@ -53,17 +56,24 @@ describe('example workflows', () => {
|
||||
skip = !!Object.keys(parsedWorkflow?.extra?.groupNodes ?? {}).length
|
||||
} catch (error) {}
|
||||
|
||||
;(skip ? test.skip : test)(
|
||||
'correctly generates prompt json for ' + file,
|
||||
async () => {
|
||||
if (!workflow || !prompt) throw new Error('Invalid example json')
|
||||
return { file, workflow, prompt, parsedWorkflow, skip }
|
||||
})
|
||||
|
||||
const { app } = await start()
|
||||
await app.loadGraphData(parsedWorkflow)
|
||||
describe.each(workflows)(
|
||||
'Workflow Test: %s',
|
||||
({ file, workflow, prompt, parsedWorkflow, skip }) => {
|
||||
;(skip ? test.skip : test)(
|
||||
'correctly generates prompt json for ' + file,
|
||||
async () => {
|
||||
if (!workflow || !prompt) throw new Error('Invalid example json')
|
||||
|
||||
const output = await app.graphToPrompt()
|
||||
expect(output.output).toEqual(fixLegacyPrompt(JSON.parse(prompt)))
|
||||
}
|
||||
)
|
||||
}
|
||||
const { app } = await start()
|
||||
await app.loadGraphData(parsedWorkflow)
|
||||
|
||||
const output = await app.graphToPrompt()
|
||||
expect(output.output).toEqual(fixLegacyPrompt(JSON.parse(prompt)))
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user