import assert from 'node:assert/strict'
import test from 'node:test'

import { resolveClaimTokenExpiration } from './claim-service.js'

test('领取链接默认可配置为长期有效', () => {
  assert.equal(resolveClaimTokenExpiration('2026-08-11T08:00:00.000Z', 0), null)
})

test('领取链接保留正整数小时的限时配置能力', () => {
  assert.equal(
    resolveClaimTokenExpiration('2026-08-11T08:00:00.000Z', 24),
    '2026-08-12T08:00:00.000Z',
  )
})
