import { describe, expect, it } from 'vitest'
import { OrganizationGraphNodeKindSchema } from '../graph/schema'
import { OrganizationModelSchema } from '../schema'

describe('retired System.content bridge', () => {
  it('rejects bridge-era content maps on System entries', () => {
    const result = OrganizationModelSchema.safeParse({
      version: 1,
      branding: { name: 'Test Org' },
      navigation: { sidebar: [] },
      systems: {
        sales: {
          id: 'sales',
          order: 10,
          label: 'Sales',
          content: {
            pipeline: {
              kind: 'schema',
              type: 'pipeline',
              label: 'Pipeline',
              data: { entityId: 'crm.deal' }
            }
          }
        }
      }
    })

    expect(result.success).toBe(false)
    expect(result.error?.issues.map((issue) => issue.path.join('.'))).toContain('systems.sales')
  })

  it('rejects content-node as a graph node kind', () => {
    expect(OrganizationGraphNodeKindSchema.safeParse('content-node').success).toBe(false)
  })
})
