test: Add unit test for projects/app/src/global/core/chat/utils.ts (#4328)

* Add unit tests for chat utility functions and enhance statistical data calculation in utils.ts.

* Update utils.ts

---------

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
Co-authored-by: Archer <545436317@qq.com>
This commit is contained in:
gru-agent[bot]
2025-03-26 13:46:21 +08:00
committed by GitHub
parent 28877373ac
commit 29a10c1389
2 changed files with 192 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ import { ChatHistoryItemResType, ChatItemType } from '@fastgpt/global/core/chat/
import { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
const isLLMNode = (item: ChatHistoryItemResType) =>
export const isLLMNode = (item: ChatHistoryItemResType) =>
item.moduleType === FlowNodeTypeEnum.chatNode || item.moduleType === FlowNodeTypeEnum.tools;
export function transformPreviewHistories(