import { describe, expect, it } from 'vitest'
import type { FieldsClient } from './client.js'
import type { FieldValueMap } from './client.js' // re-exported from core

describe('FieldsClient seam', () => {
  it('a mock satisfies the interface', () => {
    const mock: FieldsClient = {
      getEntityValues: async () => ({}),
      setEntityValues: async () => {},
      resolveGroups: async () => [],
      listGroups: async () => [],
      createGroup: async (g) => ({ ...g, origin: 'db', id: '1' }),
      updateGroup: async (_id, _p) => ({ key: 'k', label: 'L', location: { entityType: 'e' }, fields: [], origin: 'db', id: '1' }),
      deleteGroup: async () => {},
    }
    const m: FieldValueMap = { material: 'leather' }
    expect(typeof mock.getEntityValues).toBe('function')
    expect(m.material).toBe('leather')
  })
})
