Skip to content

Commit

Permalink
feat(bs5): update badge classes (#2117)
Browse files Browse the repository at this point in the history
`badge-*` -> `bg-*`
`badge-pill` -> `rounded-pill`

Co-authored-by: Adina Johnson <adina.johnson@appfolio.com>
  • Loading branch information
2 people authored and Phoebe Gao committed Oct 27, 2021
1 parent 95e6600 commit 34cdaba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Badge.js
Expand Up @@ -33,8 +33,8 @@ const Badge = (props) => {
const classes = mapToCssModules(classNames(
className,
'badge',
'badge-' + color,
pill ? 'badge-pill' : false
'bg-' + color,
pill ? 'rounded-pill' : false
), cssModule);

if (attributes.href && Tag === 'span') {
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/Badge.spec.js
Expand Up @@ -30,18 +30,18 @@ describe('Badge', () => {
it('should render badges with secondary color', () => {
const wrapper = shallow(<Badge>Default Badge</Badge>);

expect(wrapper.hasClass('badge-secondary')).toBe(true);
expect(wrapper.hasClass('bg-secondary')).toBe(true);
});

it('should render Badges with other colors', () => {
const wrapper = shallow(<Badge color="danger">Danger Badge</Badge>);

expect(wrapper.hasClass('badge-danger')).toBe(true);
expect(wrapper.hasClass('bg-danger')).toBe(true);
});

it('should render Badges as pills', () => {
const wrapper = shallow(<Badge pill>Pill Badge</Badge>);

expect(wrapper.hasClass('badge-pill')).toBe(true);
expect(wrapper.hasClass('rounded-pill')).toBe(true);
});
});

0 comments on commit 34cdaba

Please sign in to comment.