import { describe, it, expect } from 'vitest'
import { getNextStatus, shouldTransitionStatus } from '@/hooks/youtubeContent/autoStatusTransitions'

describe('Auto Status Transitions', () => {
  it('should transition to published when upload is complete', () => {
    const result = getNextStatus({
      currentStatus: 'upload_scheduled',
      youtubeVideoId: 'VID123',
      hasAllChecklistsComplete: false,
    })
    expect(result).toBe('published')
  })

  it('should not transition if no video ID on upload_scheduled', () => {
    const result = getNextStatus({
      currentStatus: 'upload_scheduled',
      youtubeVideoId: null,
      hasAllChecklistsComplete: false,
    })
    expect(result).toBeNull()
  })

  it('should transition approved to upload_scheduled when video file exists', () => {
    const result = shouldTransitionStatus('approved', { hasVideoFile: true })
    expect(result).toBe(true)
  })

  it('should not suggest transition for published status', () => {
    const result = shouldTransitionStatus('published', { hasVideoFile: true })
    expect(result).toBe(false)
  })
})
