import { describe, expect, it } from 'vitest'
import {
  CartMigrateError,
  cartSchema,
  createDbCartStore,
  isCartMigrateError,
  pushSchema,
} from './index.js'

describe('@platform-modules/commerce-cart/store-db barrel', () => {
  it('exports every named store-db symbol', () => {
    expect(typeof createDbCartStore).toBe('function')
    expect(typeof pushSchema).toBe('function')
    expect(typeof CartMigrateError).toBe('function')
    expect(typeof isCartMigrateError).toBe('function')
    expect(cartSchema).toBeDefined()
    expect(cartSchema.cart).toBeDefined()
    expect(cartSchema.cartLine).toBeDefined()
    expect(isCartMigrateError(new CartMigrateError('boom'))).toBe(true)
  })
})
