test: Add unit test for projects/app/src/pages/api/core/dataset/paths.ts (#4349)

* Add unit tests for the getParents function in the dataset paths API.

* Update paths.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-27 10:38:55 +08:00
committed by GitHub
parent cb29076e5b
commit 0778508908
2 changed files with 83 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ async function handler(req: NextApiRequest) {
return await getParents(type === 'current' ? dataset._id : dataset.parentId);
}
async function getParents(parentId?: string): Promise<ParentTreePathItemType[]> {
export async function getParents(parentId?: string): Promise<ParentTreePathItemType[]> {
if (!parentId) {
return [];
}