Files
prompt-optimizer/packages/ui/tests/unit/image/image-image2image-reference-guards.spec.ts
linshen 46d7d0552d feat(image): refine reference style migration flow
- Strengthen the style migration contract around natural subject integration and visual hierarchy
- Remove the image2image reference extraction entry from the migrated UI flow
- Normalize migration placeholders and document the updated migration design
2026-04-01 23:24:51 +08:00

23 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
const readSource = (relativePath: string) =>
readFileSync(resolve(process.cwd(), relativePath), 'utf8')
describe('image2image reference entry guards', () => {
it('removes reference extraction entry from image2image without affecting text2image reference flow', () => {
const image2imageSource = readSource('src/components/image-mode/ImageImage2ImageWorkspace.vue')
const text2imageSource = readSource('src/components/image-mode/ImageText2ImageWorkspace.vue')
expect(image2imageSource).not.toMatch(/image-image2image-extract-button/)
expect(image2imageSource).not.toMatch(/openExtractImagePicker/)
expect(image2imageSource).not.toMatch(/handleExtractImageFileChange/)
expect(image2imageSource).not.toMatch(/extractPromptFromReferenceImage/)
expect(image2imageSource).not.toMatch(/resolveReferencePromptPreview/)
expect(image2imageSource).not.toMatch(/extractImageInputRef/)
expect(text2imageSource).toMatch(/resolveReferencePromptPreview/)
expect(text2imageSource).toMatch(/referenceActionButtons/)
})
})