import { describe, it, expect, vi } from 'vitest'

import { debugProps } from '@/lib/debug'

describe('debugProps', () => {
  it('returns data-debug-id attr in dev mode', () => {
    const result = debugProps('sprint-board', 'SprintBoard', 'components/sprint/sprint-board.tsx')
    expect(result).toEqual({
      'data-debug-id': 'sprint-board',
    })
  })

  it('returns empty object in production mode', () => {
    const original = process.env.NODE_ENV
    try {
      vi.stubEnv('NODE_ENV', 'production')
      const result = debugProps('sprint-board', 'SprintBoard', 'components/sprint/sprint-board.tsx')
      expect(result).toEqual({})
    } finally {
      vi.stubEnv('NODE_ENV', original ?? 'test')
    }
  })
})
