feat: Adds number validation for WhatsApp inbox at the creation step (#6043)

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Sivin Varghese
2022-12-13 09:22:37 +05:30
committed by GitHub
parent 86958278cd
commit 9d78f0d6c6
6 changed files with 25 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
import { shouldBeUrl } from '../Validators';
import { isValidPassword } from '../Validators';
import { isNumber } from '../Validators';
describe('#shouldBeUrl', () => {
it('should return correct url', () => {
@@ -22,3 +23,15 @@ describe('#isValidPassword', () => {
expect(isValidPassword('testPass!')).toEqual(false);
});
});
describe('#isNumber', () => {
it('should return correct number', () => {
expect(isNumber('123')).toEqual(true);
});
it('should return wrong number', () => {
expect(isNumber('123-')).toEqual(false);
expect(isNumber('123./')).toEqual(false);
expect(isNumber('string')).toEqual(false);
});
});