LCOV - code coverage report
Current view: top level - src/platform/workspace/utils - platformLink.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 6 6
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import {
       2              :   isWorkspaceId,
       3              :   withWorkspaceLink
       4              : } from '@comfyorg/account-core/workspaceLink'
       5              : 
       6              : import { getComfyPlatformBaseUrl } from '@/config/comfyApi'
       7              : import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
       8              : 
       9              : /** A platform URL for `path` that opens in the cloud app's active workspace, when there is one, and carries `correlationId` when given. */
      10            4 : export function platformLink(
      11              :   path: `/${string}`,
      12              :   correlationId?: string
      13              : ): string {
      14            4 :   const url = new URL(`${getComfyPlatformBaseUrl()}${path}`)
      15            4 :   if (correlationId) url.searchParams.set('correlation_id', correlationId)
      16            4 :   const workspaceId = useTeamWorkspaceStore().activeWorkspaceId
      17            4 :   if (!workspaceId || !isWorkspaceId(workspaceId)) return url.href
      18            4 :   return withWorkspaceLink(url, workspaceId).href
      19              : }
        

Generated by: LCOV version 2.0-1