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:
Kelly Yang
2026-04-15 13:20:44 -07:00
parent a8e1fa8bef
commit 8bf00e1a5c
5 changed files with 2 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
// oxlint-disable no-empty-pattern
// TODO: Fix these tests after migration
import { afterEach, describe, expect, vi } from 'vitest'
import type {

View File

@@ -1,4 +1,3 @@
// TODO: Fix these tests after migration
import { beforeEach, describe, expect, it, vi } from 'vitest'
import {

View File

@@ -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'

View File

@@ -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: {

View File

@@ -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