2021-09-28 07:03:08 +00:00
|
|
|
import { shouldBeUrl } from '../Validators';
|
2022-04-12 05:38:12 +00:00
|
|
|
import { isValidPassword } from '../Validators';
|
2021-09-28 07:03:08 +00:00
|
|
|
|
|
|
|
describe('#shouldBeUrl', () => {
|
|
|
|
it('should return correct url', () => {
|
|
|
|
expect(shouldBeUrl('http')).toEqual(true);
|
|
|
|
});
|
|
|
|
});
|
2022-04-12 05:38:12 +00:00
|
|
|
|
|
|
|
describe('#isValidPassword', () => {
|
|
|
|
it('should return correct password', () => {
|
|
|
|
expect(isValidPassword('testPass4!')).toEqual(true);
|
|
|
|
expect(isValidPassword('testPass4-')).toEqual(true);
|
|
|
|
expect(isValidPassword('testPass4\\')).toEqual(true);
|
|
|
|
expect(isValidPassword("testPass4'")).toEqual(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return wrong password', () => {
|
|
|
|
expect(isValidPassword('testpass4')).toEqual(false);
|
|
|
|
expect(isValidPassword('testPass4')).toEqual(false);
|
|
|
|
expect(isValidPassword('testpass4!')).toEqual(false);
|
|
|
|
expect(isValidPassword('testPass!')).toEqual(false);
|
|
|
|
});
|
|
|
|
});
|