mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-17 00:14:55 +00:00
Adds name validation
This commit is contained in:
1 parent
5e20f5ea74
commit
e042b69b2a
2 files changed
+16
-5
No files matched your search
+12
-1
@@ -10,9 +10,20 @@ describe('Domains', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isValidDomainData', () => {
|
||||
describe('validateDomainData', () => {
|
||||
it('should return true if the name is invalid', () => {
|
||||
const { valid, errors } = validateDomainData({
|
||||
name: 'hello world',
|
||||
forceHttps: true,
|
||||
record: { CNAME: ['hello.com'] },
|
||||
});
|
||||
expect(valid).toBe(false);
|
||||
expect(errors[0][0]).toBe('name');
|
||||
});
|
||||
|
||||
it('should return true for a valid object', () => {
|
||||
const { valid, errors } = validateDomainData({
|
||||
name: 'something',
|
||||
forceHttps: true,
|
||||
record: { CNAME: ['hello.com'] },
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user