Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('gridClassName - object', () => {
expect(gridClassName({ md: 3 }, 'input')).toBe('col-9 col-md-9');
expect(gridClassName({ md: 5 }, 'input')).toBe('col-7 col-md-7');
expect(gridClassName({ md: 7 }, 'input')).toBe('col-5 col-md-5');
expect(gridClassName({ md: 9 }, 'input')).toBe('col-3 col-md-3');
expect(gridClassName({ md: 3, xs: 2 }, 'input')).toBe('col-10 col-md-9');
expect(gridClassName({ md: 5, xs: 4 }, 'input')).toBe('col-8 col-md-7');
expect(gridClassName({ md: 7, xs: 6 }, 'input')).toBe('col-6 col-md-5');
expect(gridClassName({ md: 9, xs: 8 }, 'input')).toBe('col-4 col-md-3');
expect(gridClassName({ sm: 11, md: 9, xs: 8, xl: 2, lg: 5 }, 'input')).toBe(
'col-4 col-sm-1 col-md-3 col-lg-7 col-xl-10'
);
expect(gridClassName({ xl: 2, lg: 5, md: 9, sm: 11, xs: 8 }, 'input')).toBe(
'col-4 col-sm-1 col-md-3 col-lg-7 col-xl-10'
);
expect(gridClassName({ lg: 9, xs: 8, md: 2, xl: 5 }, 'input')).toBe(
'col-4 col-md-10 col-lg-3 col-xl-7'
);
test('gridClassName - number', () => {
expect(gridClassName(3, 'input')).toBe('col-9');
expect(gridClassName(3, 'label')).toBe('col-3');
expect(gridClassName(5, 'input')).toBe('col-7');
expect(gridClassName(5, 'label')).toBe('col-5');
});
test('gridClassName - string', () => {
expect(gridClassName('col-9 col-md-9')).toBe('col-9 col-md-9');
expect(gridClassName('col-3 col-md-3')).toBe('col-3 col-md-3');
expect(gridClassName('col-7 col-md-7')).toBe('col-7 col-md-7');
expect(gridClassName('col-5 col-md-5')).toBe('col-5 col-md-5');
});
test('gridClassName - number', () => {
expect(gridClassName(3, 'input')).toBe('col-9');
expect(gridClassName(3, 'label')).toBe('col-3');
expect(gridClassName(5, 'input')).toBe('col-7');
expect(gridClassName(5, 'label')).toBe('col-5');
});
test('gridClassName - number (string)', () => {
expect(gridClassName('3', 'input')).toBe('col-9');
expect(gridClassName('3', 'label')).toBe('col-3');
expect(gridClassName('5', 'input')).toBe('col-7');
expect(gridClassName('5', 'label')).toBe('col-5');
});
test('gridClassName - number', () => {
expect(gridClassName(3, 'input')).toBe('col-9');
expect(gridClassName(3, 'label')).toBe('col-3');
expect(gridClassName(5, 'input')).toBe('col-7');
expect(gridClassName(5, 'label')).toBe('col-5');
});
test('gridClassName - string', () => {
expect(gridClassName('col-9 col-md-9')).toBe('col-9 col-md-9');
expect(gridClassName('col-3 col-md-3')).toBe('col-3 col-md-3');
expect(gridClassName('col-7 col-md-7')).toBe('col-7 col-md-7');
expect(gridClassName('col-5 col-md-5')).toBe('col-5 col-md-5');
});
test('gridClassName - number (string)', () => {
expect(gridClassName('3', 'input')).toBe('col-9');
expect(gridClassName('3', 'label')).toBe('col-3');
expect(gridClassName('5', 'input')).toBe('col-7');
expect(gridClassName('5', 'label')).toBe('col-5');
});
test('gridClassName - string', () => {
expect(gridClassName('col-9 col-md-9')).toBe('col-9 col-md-9');
expect(gridClassName('col-3 col-md-3')).toBe('col-3 col-md-3');
expect(gridClassName('col-7 col-md-7')).toBe('col-7 col-md-7');
expect(gridClassName('col-5 col-md-5')).toBe('col-5 col-md-5');
});
test(' - renders error block (showInlineError=false)', () => {
const error = new Error();
const element = wrapField(
{ error, showInlineError: false, errorMessage: 'Error' },
<div>,
);
const wrapper = mount(element);
expect(wrapper.find('.text-danger')).toHaveLength(0);
});
</div>