/** * Integration test: RunOnce form lifecycle * * Tests the complete user journey: * Init defaults → edit fields → submit → running state → stop */ import type { InputValueTypes } from '@/app/components/share/text-generation/types' import type { PromptConfig, PromptVariable } from '@/models/debug' import type { SiteInfo } from '@/models/share' import type { VisionSettings } from '@/types/app' import { fireEvent, render, screen, waitFor } from '@testing-library/react' import * as React from 'react' import { useRef, useState } from 'react' import RunOnce from '@/app/components/share/text-generation/run-once' import { Resolution, TransferMethod } from '@/types/app' vi.mock('@/hooks/use-breakpoints', () => ({ default: vi.fn(() => 'pc'), MediaType: { pc: 'pc', pad: 'pad', mobile: 'mobile' }, })) vi.mock('@/app/components/workflow/nodes/_base/components/editor/code-editor', () => ({ default: ({ value, onChange }: { value?: string, onChange?: (val: string) => void }) => (