mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-10-17 21:29:20 +02:00
16 lines
571 B
TypeScript
16 lines
571 B
TypeScript
import * as assert from 'node:assert/strict'
|
|
import { test } from 'node:test'
|
|
|
|
import { normalizeCustomUrl } from '../../app/validators/system.js'
|
|
|
|
test('rejects a normalized custom URL that exceeds the database column size', () => {
|
|
const tooLongHost = 'a'.repeat(247)
|
|
assert.equal(normalizeCustomUrl(`https://${tooLongHost}`), null)
|
|
})
|
|
|
|
test('accepts a normalized custom URL at the database column limit', () => {
|
|
const maxLengthHost = 'a'.repeat(246)
|
|
const normalized = normalizeCustomUrl(`https://${maxLengthHost}`)
|
|
assert.equal(normalized?.length, 255)
|
|
})
|