diff --git a/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx b/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx index c2a5c252f..efdc1e037 100644 --- a/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx +++ b/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx @@ -526,7 +526,10 @@ test('pre-send validation falls back when the selected model is disabled', async await act(async () => { await expect(ref.current?.ensureUsable()).resolves.toBe(true); }); - expect(screen.getByText('所选模型已停用,已切换为默认模型')).not.toBeNull(); + // 状态文案现在走组件自带的底部 toast(portal 到 body):等它出现,别用同步查询。 + expect( + await screen.findByText('所选模型已停用,已切换为默认模型'), + ).not.toBeNull(); expect(savedModelId).toBe('quality'); expect(invoke).toHaveBeenCalledWith('select_game_creator_model', { modelId: 'quality', @@ -552,7 +555,7 @@ test('follows the new server default when the saved selection was the default', await waitFor(() => expect(savedModelId).toBe('fast')); expect(savedModelIsDefault).toBe(true); expect( - screen.getByText('默认模型已更新,已切换为新的默认模型'), + await screen.findByText('默认模型已更新,已切换为新的默认模型'), ).not.toBeNull(); expect(invoke).toHaveBeenCalledWith('select_game_creator_model', { modelId: 'fast',