[BugFix] Remove outputs.animated in queueStore (#2740)

This commit is contained in:
Chenlei Hu
2025-02-26 16:04:01 -05:00
committed by GitHub
parent 1c408d2f6a
commit bdfa2efa50
2 changed files with 51 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
// @ts-strict-ignore
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')
})
})