fix(short-drama-agent-front): 修复代码格式检查问题
This commit is contained in:
1 parent
81d6a85260
commit
48fce3975f
87 files changed
+5714
-1436
No files matched your search
@@ -18,8 +18,17 @@ function mountFields(schemas: GenerationOptionSchema[]) {
|
||||
describe('生成模型参数字段', () => {
|
||||
it('只有目录声明支持的模型才提供智能时长,不按模型品牌补造 -1', () => {
|
||||
for (const supported of [false, true]) {
|
||||
const wrapper = mountFields([{ key: 'durationSeconds', label: '生成时长', type: 'integer', required: true,
|
||||
min: 4, max: 6, ...(supported ? { specialValues: [{ label: '智能时长', value: -1 }] } : {}) }])
|
||||
const wrapper = mountFields([
|
||||
{
|
||||
key: 'durationSeconds',
|
||||
label: '生成时长',
|
||||
type: 'integer',
|
||||
required: true,
|
||||
min: 4,
|
||||
max: 6,
|
||||
...(supported ? { specialValues: [{ label: '智能时长', value: -1 }] } : {})
|
||||
}
|
||||
])
|
||||
const options = wrapper.getComponent(NSelect).props('options') as { value: number }[]
|
||||
expect(options.some(item => item.value === -1)).toBe(supported)
|
||||
wrapper.unmount()
|
||||
|
||||
@@ -19,15 +19,37 @@ afterEach(() => wrapper?.unmount())
|
||||
*/
|
||||
async function settings() {
|
||||
const saved = generationProfile('config-contract')
|
||||
const catalog = { ...imageCatalog, videos: [{ ...imageCatalog.images[0]!, type: 'video' as const, provider: 'seedance', model: 'seedance', generationOptions: [], defaults: {} }] }
|
||||
const catalog = {
|
||||
...imageCatalog,
|
||||
videos: [
|
||||
{
|
||||
...imageCatalog.images[0]!,
|
||||
type: 'video' as const,
|
||||
provider: 'seedance',
|
||||
model: 'seedance',
|
||||
generationOptions: [],
|
||||
defaults: {}
|
||||
}
|
||||
]
|
||||
}
|
||||
vi.spyOn(generationConfigApi, 'catalog').mockResolvedValue(catalog)
|
||||
vi.spyOn(generationConfigApi, 'profile').mockResolvedValue(saved)
|
||||
const save = vi.spyOn(generationConfigApi, 'saveProfile').mockResolvedValue(saved)
|
||||
const messages = { success: vi.fn<MessageApi['success']>(), warning: vi.fn<MessageApi['warning']>(), error: vi.fn<MessageApi['error']>(), info: vi.fn<MessageApi['info']>() }
|
||||
const messages = {
|
||||
success: vi.fn<MessageApi['success']>(),
|
||||
warning: vi.fn<MessageApi['warning']>(),
|
||||
error: vi.fn<MessageApi['error']>(),
|
||||
info: vi.fn<MessageApi['info']>()
|
||||
}
|
||||
const revision = ref(0)
|
||||
wrapper = mount(CreativeProfileSettings, {
|
||||
props: { projectId: saved.projectId },
|
||||
global: { provide: { [actionMessageKey as symbol]: messages as unknown as MessageApi, [projectGenerationRevisionKey as symbol]: revision } }
|
||||
global: {
|
||||
provide: {
|
||||
[actionMessageKey as symbol]: messages as unknown as MessageApi,
|
||||
[projectGenerationRevisionKey as symbol]: revision
|
||||
}
|
||||
}
|
||||
})
|
||||
await flushPromises()
|
||||
return { saved, save, messages, revision }
|
||||
|
||||
Reference in new issue
Block a user