LCOV - code coverage report
Current view: top level - src/platform/billing/composables - useAutoTopUpCardViewed.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 type { AutoTopUpCardStatus } from '@comfyorg/account-core/billing'
       2              : import { watch } from 'vue'
       3              : 
       4              : import { useTelemetry } from '@comfyorg/telemetry'
       5              : 
       6            5 : export function useAutoTopUpCardViewed(
       7              :   renderedStatus: () => AutoTopUpCardStatus | undefined
       8              : ) {
       9            5 :   let reportedStatus: AutoTopUpCardStatus | undefined
      10              : 
      11            5 :   watch(
      12              :     renderedStatus,
      13              :     (status) => {
      14            7 :       if (!status || status === reportedStatus) return
      15            2 :       reportedStatus = status
      16            7 :       useTelemetry()?.trackBillingEvent({
      17              :         operation: 'auto_top_up_card',
      18              :         stage: 'viewed',
      19              :         outcome: 'pending',
      20              :         status
      21              :       })
      22              :     },
      23              :     { immediate: true }
      24              :   )
      25              : }
        

Generated by: LCOV version 2.0-1