How to use @rxweb/reactive-form-validators - 10 common examples

To help you get started, we’ve selected a few @rxweb/reactive-form-validators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rxweb / rxweb / test / reactive-form-validators / decorator / maxDate.decorator.spec.ts View on Github external
describe('Decorator', () => {
        let formBuilder = new RxFormBuilder();
        beforeEach(() => {
            ReactiveFormConfig.set({
                "validationMessage": {
                    "maxDate": "Maximum Date is not matched",
                }
            });
        });

        describe('maxDateDecorator', () => {

            it('should not error in allocationDate property with null value.',
                () => {
                    let formGroup = formBuilder.formGroup(User);
                    expect(formGroup.controls.allocationDate.errors).toBeNull();
                });
github rxweb / rxweb / test / reactive-form-validators / decorator / password.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
      ReactiveFormConfig.set({
        "validationMessage": {
          "password": "Invalid Password",
        }
      });
    });

    describe('passwordDecorator', () => {

	
	 it("Should not error, password decorator  ",
        () => {
		let loginInfo = new LoginInfo();
        loginInfo.newPassword = undefined;
        let formGroup = formBuilder.formGroup(loginInfo);
github rxweb / rxweb / test / reactive-form-validators / decorator / allOf.decorator.spec.ts View on Github external
describe('Decorator', () => {
      let formBuilder = new RxFormBuilder();
      beforeEach(() => {
        ReactiveFormConfig.set({
          "validationMessage": {
            "allOf": "Please select all options",
          }
        });
      });
      describe('allOfDecorator', () => {
        it("Should not error, allOf decorator.",
        () => {
		let employeeInfo = new EmployeeInfo();
        let formGroup = formBuilder.formGroup(employeeInfo);
        formGroup.controls.projectDomains.setValue(["ECommerce", "Banking","Educational","Gaming"]);
        expect(formGroup.controls.projectDomains.errors).toBeNull();
     });
github rxweb / rxweb / test / reactive-form-validators / decorator / mac.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
      ReactiveFormConfig.set({
        "validationMessage": {
          "mac": "Enter valid MAC address.",
        }
      });
    });

    describe('macDecorator', () => {

	
    it("Should not error, mac decorator  Conditional Expression with type 'function'",
        () => {
		let macAddressInfo = new MacAddressInfo();
		macAddressInfo.device = 'Laptop';
        let formGroup = formBuilder.formGroup(macAddressInfo);
github rxweb / rxweb / test / reactive-form-validators / decorator / greaterThan.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
      ReactiveFormConfig.set({
        "validationMessage": {
          "greaterThan": "value should be greater than field",
        }
      });
    });

    describe('greaterThanDecorator', () => {

	
    it("Should not error, greaterThan decorator  If you want to apply conditional validation on 'Voter Age' then need to add 'Age' field greater than '17'.",
        () => {
		let user = new User();
		user.age = 18;
        let formGroup = formBuilder.formGroup(user);
github rxweb / rxweb / test / reactive-form-validators / decorator / ascii.decorator.spec.ts View on Github external
describe('Decorator', () => {
      let formBuilder = new RxFormBuilder();
      beforeEach(() => {
        ReactiveFormConfig.set({
          "validationMessage": {
            "ascii": "Please enter an ascii code",
          }
        });
      });

      describe('asciiDecorator', () => {
     
        
      it("Should not error, ascii decorator  If you want to apply conditional expression of type 'function'",
          () => {
          let user  = new User ();
          user.language = 'Java';
          let formGroup = formBuilder.formGroup(user);
github rxweb / rxweb / test / reactive-form-validators / decorator / date.decorator.spec.ts View on Github external
describe('Decorator', () => {
        let formBuilder = new RxFormBuilder();
        beforeEach(() => {
            ReactiveFormConfig.set({
                "validationMessage": {
                    "date": "enter correct date.",
                },
                "baseConfig": {
                    "dateFormat": "dmy",
                    "seperator": "/"
                }
            });
        });

        describe('dateDecorator', () => {

            it('should not error in allocationDate property with null value.',
                () => {
github rxweb / rxweb / test / reactive-form-validators / decorator / creditCard.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
        ReactiveFormConfig.set({
            "validationMessage": {
                "creditCard": "Invalid creditcard no.",
            }
        });
    });

    describe('creditCardDecorator', () => {
        it("Should error, creditCard decorator Conditional Expression with type 'function'",
            () => {
                let user = new User();
                let formGroup = formBuilder.formGroup(user);
                formGroup.controls.cardType.setValue('Visa');
                formGroup.controls.visaCard.setValue('1214210');
                expect(formGroup.controls.visaCard.errors).toEqual({ 'creditCard': { message: 'Invalid Visa Credit Card Number.', refValues: ['1214210', 'Visa'] } });
github rxweb / rxweb / test / reactive-form-validators / decorator / odd.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
      ReactiveFormConfig.set({
        "validationMessage": {
          "odd": "Enter a valid odd number.",
        }
      });
    });

    describe('oddDecorator', () => {

	
    it("Should not error, odd decorator  Conditional Expression with type 'function'",
        () => {
		let user = new User();
		user.type = 'Odd';
        let formGroup = formBuilder.formGroup(user);
github rxweb / rxweb / test / reactive-form-validators / decorator / different.decorator.spec.ts View on Github external
describe('Decorator', () => {
    let formBuilder = new RxFormBuilder();
    beforeEach(() => {
      ReactiveFormConfig.set({
        "validationMessage": {
          "different": "Do not enter same inputs.",
        }
      });
    });

    describe('differentDecorator', () => {

	
    it("Should not error, different decorator  Last Name and First Name must be different",
        () => {
		let accountInfo = new AccountInfo();
		accountInfo.firstName = 'Mukesh';
        let formGroup = formBuilder.formGroup(accountInfo);

@rxweb/reactive-form-validators

[![Build Status](https://dev.azure.com/ajayojha/rxweb/_apis/build/status/rxweb-CI?branchName=master)](https://dev.azure.com/ajayojha/rxweb/_build/latest?definitionId=39&branchName=master) [![Gitter](https://badges.gitter.im/rx-web/Lobby.svg)](https://git

MIT
Latest version published 12 months ago

Package Health Score

64 / 100
Full package analysis