How to use the @inkline/inkline/src/validators/required.required function in @inkline/inkline

To help you get started, we’ve selected a few @inkline/inkline 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 inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return false if value is empty string', () => {
            expect(required('')).toEqual(false);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return false if value is null', () => {
            expect(required(null)).toEqual(false);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return true if value is boolean', () => {
            expect(required(true)).toEqual(true);
            expect(required(false)).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return true if value is non-empty string', () => {
            expect(required('example')).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return true if array is not empty', () => {
            expect(required(['a', 'b'])).toEqual(true);
        });
    });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return false if value is undefined', () => {
            expect(required(undefined)).toEqual(false);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return false if value is blank string', () => {
            expect(required('  ')).toEqual(false);
        });
github inkline / inkline / tests / unit / validators / required.spec.js View on Github external
it('should return true if value is boolean', () => {
            expect(required(true)).toEqual(true);
            expect(required(false)).toEqual(true);
        });