const { describe, it } = require('node:test')
const assert = require('node:assert/strict')
const { createVersion } = require('./version')

describe('createVersion', () => {
  it('throws when template id is missing', async () => {
    await assert.rejects(
      () => createVersion('app-1', '', { name: 'Hero' }),
      /Template ID is required/,
    )
  })

  it('throws when template id is null', async () => {
    await assert.rejects(
      () => createVersion('app-1', null, { code: 'export default {}' }),
      /Template ID is required/,
    )
  })
})
