Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(bs5): replace form-group class with mb-3
  • Loading branch information
Phoebe Gao authored and phwebi committed Oct 27, 2021
1 parent 35a37ef commit cbcb2e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/lib/Components/FormPage.js
Expand Up @@ -117,7 +117,7 @@ FormGroup.propTypes = {
children: PropTypes.node,
// Applied the row class when true, does nothing when false
row: PropTypes.bool,
// Applied the form-check class when true, form-group when false
// Applied the form-check class when true, mb-3 when false
check: PropTypes.bool,
inline: PropTypes.bool,
// Applied the disabled class when the check and disabled props are true, does nothing when false
Expand Down
2 changes: 1 addition & 1 deletion src/FormGroup.js
Expand Up @@ -33,7 +33,7 @@ const FormGroup = (props) => {
const classes = mapToCssModules(classNames(
className,
row ? 'row' : false,
check ? 'form-check' : 'form-group',
check ? 'form-check' : 'mb-3',
check && inline ? 'form-check-inline' : false,
check && disabled ? 'disabled' : false
), cssModule);
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/FormGroup.spec.js
Expand Up @@ -15,10 +15,10 @@ describe('FormGroup', () => {
expect(wrapper.text()).toBe('Yo!');
});

it('should render with "form-group" class by default', () => {
it('should render with "mb-3" class by default', () => {
const wrapper = shallow(<FormGroup>Yo!</FormGroup>);

expect(wrapper.hasClass('form-group')).toBe(true);
expect(wrapper.hasClass('mb-3')).toBe(true);
});

it('should not render with "form-check" nor "form-check-inline" class by default', () => {
Expand Down Expand Up @@ -53,10 +53,10 @@ describe('FormGroup', () => {
expect(wrapper.hasClass('form-check-inline')).toBe(false);
});

it('should not render with "form-group" class when check prop is truthy', () => {
it('should not render with "mb-3" class when check prop is truthy', () => {
const wrapper = shallow(<FormGroup check>Yo!</FormGroup>);

expect(wrapper.hasClass('form-group')).toBe(false);
expect(wrapper.hasClass('mb-3')).toBe(false);
});

it('should not render with "disabled" class when disabled prop is truthy but check is not', () => {
Expand Down

0 comments on commit cbcb2e3

Please sign in to comment.