import { test } from '@japa/runner'
import { DataDomain } from '../../../src/index.js'

test.group('DomainEntity.toApiShape()', () => {
  test('returns an object', ({ assert }) => {
    const dataDomain = new DataDomain()
    const model = dataDomain.addModel()
    const entity = model.addEntity()
    const result = entity.toApiShape()
    assert.typeOf(result, 'object')
  })

  test('returns an object with the correct kind', ({ assert }) => {
    const dataDomain = new DataDomain()
    const model = dataDomain.addModel()
    const entity = model.addEntity()
    const result = entity.toApiShape()
    assert.equal(result.id, entity.key)
  })
})
