import { kaufs, kauf, deleteKauf } from './kaufs'

// Generated boilerplate tests do not account for all circumstances
// and can fail without adjustments, e.g. Float.
//           Please refer to the RedwoodJS Testing Docs:
//       https://redwoodjs.com/docs/testing#testing-services
// https://redwoodjs.com/docs/testing#jest-expect-type-considerations

describe('kaufs', () => {
  scenario('returns all kaufs', async (scenario) => {
    const result = await kaufs()

    expect(result.length).toEqual(Object.keys(scenario.kauf).length)
  })

  scenario('returns a single kauf', async (scenario) => {
    const result = await kauf({ id: scenario.kauf.one.id })

    expect(result).toEqual(scenario.kauf.one)
  })

  scenario('deletes a kauf', async (scenario) => {
    const original = await deleteKauf({ id: scenario.kauf.one.id })
    const result = await kauf({ id: original.id })

    expect(result).toEqual(null)
  })
})
