mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
fix: resolve post-migration TODO comments and skipped test
Remove stale TODO comments from 3 litegraph test files whose tests were already passing after the migration. Fix the skipped 'should parse text outputs' test in queueStore by correcting two bugs in resultItemParsing.ts: - Remove 'text' from METADATA_KEYS: text media-type outputs were being silently discarded; isResultItem already filters non-object values - Remove the filename requirement from isResultItem: filename is optional in the zResultItem schema, and text outputs carry content instead of filename Fixes #11078
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// oxlint-disable no-empty-pattern
|
||||
// TODO: Fix these tests after migration
|
||||
import { afterEach, describe, expect, vi } from 'vitest'
|
||||
|
||||
import type {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// TODO: Fix these tests after migration
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// TODO: Fix these tests after migration
|
||||
import { test as baseTest } from 'vitest'
|
||||
|
||||
import type { Point, Rect } from '@/lib/litegraph/src/interfaces'
|
||||
|
||||
@@ -189,7 +189,7 @@ describe('TaskItemImpl', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it.skip('should parse text outputs', () => {
|
||||
it('should parse text outputs', () => {
|
||||
const job: JobListItem = {
|
||||
...createHistoryJob(0, 'text-job'),
|
||||
preview_output: {
|
||||
|
||||
@@ -2,21 +2,13 @@ import type { NodeExecutionOutput, ResultItem } from '@/schemas/apiSchema'
|
||||
import { resultItemType } from '@/schemas/apiSchema'
|
||||
import { ResultItemImpl } from '@/stores/queueStore'
|
||||
|
||||
const METADATA_KEYS = new Set(['animated', 'text'])
|
||||
const METADATA_KEYS = new Set(['animated'])
|
||||
|
||||
/**
|
||||
* Validates that an unknown value is a well-formed ResultItem.
|
||||
*
|
||||
* Requires `filename` (string) since ResultItemImpl needs it for a valid URL.
|
||||
* `subfolder` is optional here — ResultItemImpl constructor falls back to ''.
|
||||
*/
|
||||
function isResultItem(item: unknown): item is ResultItem {
|
||||
if (!item || typeof item !== 'object' || Array.isArray(item)) return false
|
||||
|
||||
const candidate = item as Record<string, unknown>
|
||||
|
||||
if (typeof candidate.filename !== 'string') return false
|
||||
|
||||
if (
|
||||
candidate.type !== undefined &&
|
||||
!resultItemType.safeParse(candidate.type).success
|
||||
|
||||
Reference in New Issue
Block a user