Browse Source

test: remove pristine specs from validators suite

pull/6432/head
Arman Ozak 6 years ago
parent
commit
77608b9ef0
  1. 48
      npm/ng-packs/packages/core/src/lib/tests/validators.spec.ts

48
npm/ng-packs/packages/core/src/lib/tests/validators.spec.ts

@ -37,14 +37,6 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
});
it('should return null when control is pristine', () => {
const invalidNumber = '5105105105105101';
const control = new FormControl(invalidNumber, [validateCreditCard()]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
describe('Email Validator', () => {
@ -81,14 +73,6 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
},
);
it('should return null when control is pristine', () => {
const invalidDate = '';
const control = new FormControl(invalidDate, [validateMinAge({ age: Infinity })]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
describe('Range Validator', () => {
@ -115,14 +99,6 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
},
);
it('should return null when control is pristine', () => {
const invalidUrl = '';
const control = new FormControl(invalidUrl, [validateRange({ minimum: 3 })]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
describe('Required Validator', () => {
@ -148,14 +124,6 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
},
);
it('should return null when control is pristine', () => {
const invalidUrl = '';
const control = new FormControl(invalidUrl, [validateRequired()]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
describe('String Length Validator', () => {
@ -178,14 +146,6 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
},
);
it('should return null when control is pristine', () => {
const invalidUrl = '';
const control = new FormControl(invalidUrl, [validateStringLength({ minimumLength: 3 })]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
describe('Url Validator', () => {
@ -217,13 +177,5 @@ describe('Validators', () => {
expect(control.errors).toEqual(expected);
});
it('should return null when control is pristine', () => {
const invalidUrl = 'x';
const control = new FormControl(invalidUrl, [validateUrl()]);
// control is not dirty
expect(control.valid).toBe(true);
});
});
});

Loading…
Cancel
Save