diff --git a/frontend/src/features/models/components/GlobalModelFormDialog.vue b/frontend/src/features/models/components/GlobalModelFormDialog.vue index d6de89e3e..06042368a 100644 --- a/frontend/src/features/models/components/GlobalModelFormDialog.vue +++ b/frontend/src/features/models/components/GlobalModelFormDialog.vue @@ -31,9 +31,22 @@
+

+ 正在加载在线目录;也可以先手动填写模型 +

+
{ expect(document.body.querySelector('#model-name')).not.toBeNull() }) + it('allows manual model creation while the external catalog request is still pending', async () => { + modelsDevMocks.getModelsDevList.mockReturnValueOnce( + new Promise(() => {}), + ) + + mountDialog() + await settle() + + const manualEntryButton = document.body.querySelector( + '[data-testid="models-catalog-manual-entry-loading"]', + ) + if (!manualEntryButton) throw new Error('Missing loading-state manual-entry button') + manualEntryButton.click() + await settle() + + expect(document.body.textContent).toContain('手动填写模式') + expect(document.body.querySelector('#model-name')).not.toBeNull() + }) + it('drops the previous draft and submits only the newly selected model preset', async () => { mountDialog() await settle()