mirror of
https://github.com/wahyd4/heygo.git
synced 2026-08-08 21:05:48 +10:00
test: cover invalid alias characters
This commit is contained in:
@@ -21,11 +21,13 @@ describe('alias validation', () => {
|
||||
expect(validateAlias(' ')).toEqual({ ok: false, error: 'Alias is required' });
|
||||
});
|
||||
|
||||
it('rejects path separators with exact error', () => {
|
||||
expect(validateAlias('a/b')).toEqual({
|
||||
ok: false,
|
||||
error: 'Alias may contain only letters, numbers, underscore, and hyphen',
|
||||
});
|
||||
it('rejects invalid characters with exact error', () => {
|
||||
for (const alias of ['a/b', 'a.b', 'a b', '中文']) {
|
||||
expect(validateAlias(alias)).toEqual({
|
||||
ok: false,
|
||||
error: 'Alias may contain only letters, numbers, underscore, and hyphen',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it('rejects aliases starting with hyphen or underscore', () => {
|
||||
|
||||
Reference in New Issue
Block a user