[Fix] Do not allow names with whitespaces (#5542)

As per title
This commit is contained in:
Marie
2024-05-23 07:43:09 +02:00
committed by GitHub
parent 04bf697b25
commit 6b1d4e0744
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,16 @@ describe('validateMetadataName', () => {
expect(validateMetadataName(input)).not.toThrow;
});
it('throws error if string has spaces', () => {
const input = 'name with spaces';
expect(() => validateMetadataName(input)).toThrow(InvalidStringException);
});
it('throws error if string starts with capital letter', () => {
const input = 'StringStartingWithCapitalLetter';
expect(() => validateMetadataName(input)).toThrow(InvalidStringException);
});
it('throws error if string has non latin characters', () => {
const input = 'בְרִבְרִ';