Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
653 B

import { Validators } from '@angular/forms';
import { ObjectExtensions } from '../lib/models/object-extensions';
import { getValidatorsFromProperty } from '../lib/utils/validation.util';
describe('Validation Utils', () => {
describe('#getValidatorsFromProperty', () => {
it('should return a list of validators derived from property attributes', () => {
const property = {
attributes: [
{
typeSimple: 'emailAddress',
config: {},
},
],
} as ObjectExtensions.ExtensionPropertyDto;
expect(getValidatorsFromProperty(property)[0]).toBe(Validators.email);
});
});
});