// tests/mockup-handdrawn-component.test.ts
import { describe, it, expect } from 'vitest'
import { checkNonInstanceComponent } from '../scripts/audit-mockup-library-binding.mjs'

describe('checkNonInstanceComponent (handdrawn warn)', () => {
  it('flags a FRAME named "Button" that is not an INSTANCE', () => {
    expect(checkNonInstanceComponent({ id: '1', type: 'FRAME', name: 'Button' })).toBeTruthy()
  })
  it('flags "primary checkbox" frame', () => {
    expect(checkNonInstanceComponent({ id: '2', type: 'FRAME', name: 'primary checkbox' })).toBeTruthy()
  })
  it('does NOT flag an INSTANCE named Button', () => {
    expect(checkNonInstanceComponent({ id: '3', type: 'INSTANCE', name: 'Button' })).toBeNull()
  })
  it('does NOT flag unrelated frame name', () => {
    expect(checkNonInstanceComponent({ id: '4', type: 'FRAME', name: 'Header container' })).toBeNull()
  })
  it('respects [[mock]] ignore marker', () => {
    expect(checkNonInstanceComponent({ id: '5', type: 'FRAME', name: 'Button [[mock]]' })).toBeNull()
  })
})
