支持领取链接长期有效

This commit is contained in:
yml2213
2026-08-11 14:06:29 +08:00
parent e72c936986
commit e097ddad3d
13 changed files with 65 additions and 9 deletions
@@ -88,7 +88,7 @@ test('validateRuntimeConfig catches invalid numeric and url values', () => {
},
orders: {
claimBaseUrl: 'not-a-url',
tokenTtlHours: 0,
tokenTtlHours: -1,
},
}),
{
@@ -102,6 +102,19 @@ test('validateRuntimeConfig catches invalid numeric and url values', () => {
)
})
test('validateRuntimeConfig accepts zero claim token TTL for permanent links', () => {
const issues = validateRuntimeConfig(
createRuntimeConfig({
orders: {
tokenTtlHours: 0,
},
}),
{ env: { NODE_ENV: 'development' } },
)
assert.deepEqual(issues, [])
})
test('assertRuntimeConfigValid throws a readable validation error', () => {
assert.throws(
() => {