mirror of
https://github.com/linshenkx/prompt-optimizer.git
synced 2026-07-02 13:24:18 +08:00
- Link test source cues back to prompt panel areas - Add source-linked cards, variant tags, and feedback composables - Add image model quick switching and workspace control polish
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { mount } from '@vue/test-utils'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import TestSourceLinkedCard from '../../../src/components/TestSourceLinkedCard.vue'
|
|
|
|
const mountCard = (props: Record<string, unknown>) =>
|
|
mount(TestSourceLinkedCard, {
|
|
props,
|
|
slots: {
|
|
default: 'Linked area',
|
|
},
|
|
})
|
|
|
|
describe('TestSourceLinkedCard', () => {
|
|
it('keeps the source tone on the linked left-side area', () => {
|
|
const wrapper = mountCard({
|
|
sourceTone: 'workspace',
|
|
feedbackKey: 1,
|
|
feedbackTone: 'change',
|
|
})
|
|
|
|
const card = wrapper.get('.test-source-linked-card')
|
|
expect(card.text()).toContain('Linked area')
|
|
expect(card.attributes('data-source-tone')).toBe('workspace')
|
|
expect(card.attributes('data-feedback-tone')).toBe('change')
|
|
expect(card.classes()).toContain('test-source-linked-card--feedback-change')
|
|
expect(wrapper.get('.test-source-linked-card__pulse').classes()).toContain(
|
|
'test-source-linked-card__pulse--change',
|
|
)
|
|
})
|
|
|
|
it('uses the error feedback class for UI-level interception', () => {
|
|
const wrapper = mountCard({
|
|
sourceTone: 'original',
|
|
feedbackKey: 2,
|
|
feedbackTone: 'error',
|
|
})
|
|
|
|
expect(wrapper.get('.test-source-linked-card').classes()).toContain(
|
|
'test-source-linked-card--feedback-error',
|
|
)
|
|
expect(wrapper.get('.test-source-linked-card__pulse').classes()).toContain(
|
|
'test-source-linked-card__pulse--error',
|
|
)
|
|
})
|
|
})
|