mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 13:29:55 +00:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
// @ts-strict-ignore
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { TaskItemImpl } from '@/stores/queueStore'
|
|
|
|
describe('TaskItemImpl', () => {
|
|
it('should remove animated property from outputs during construction', () => {
|
|
const taskItem = new TaskItemImpl(
|
|
'History',
|
|
[0, 'prompt-id', {}, {}, []],
|
|
{ status_str: 'success', messages: [] },
|
|
{
|
|
'node-1': {
|
|
images: [{ filename: 'test.png', type: 'output', subfolder: '' }],
|
|
animated: [false]
|
|
}
|
|
}
|
|
)
|
|
|
|
// Check that animated property was removed
|
|
expect('animated' in taskItem.outputs['node-1']).toBe(false)
|
|
|
|
// Verify other output properties remain intact
|
|
expect(taskItem.outputs['node-1'].images).toBeDefined()
|
|
expect(taskItem.outputs['node-1'].images[0].filename).toBe('test.png')
|
|
})
|
|
|
|
it('should handle outputs without animated property', () => {
|
|
const taskItem = new TaskItemImpl(
|
|
'History',
|
|
[0, 'prompt-id', {}, {}, []],
|
|
{ status_str: 'success', messages: [] },
|
|
{
|
|
'node-1': {
|
|
images: [{ filename: 'test.png', type: 'output', subfolder: '' }]
|
|
}
|
|
}
|
|
)
|
|
|
|
// Verify outputs are preserved when no animated property exists
|
|
expect(taskItem.outputs['node-1'].images).toBeDefined()
|
|
expect(taskItem.outputs['node-1'].images[0].filename).toBe('test.png')
|
|
})
|
|
})
|