Skip to content

Commit

Permalink
fix(Toast): Fix bsPrefix (#5240)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Jun 15, 2020
1 parent eef3791 commit 501b3bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Toast = React.forwardRef(
},
ref,
) => {
bsPrefix = useBootstrapPrefix('toast');
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast');
const delayRef = useRef(delay);
const onCloseRef = useRef(onClose);

Expand Down
9 changes: 9 additions & 0 deletions test/ToastSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,13 @@ describe('<Toast>', () => {
clock.restore();
}
});

it('should render with bsPrefix', () => {
mount(
<Toast bsPrefix="my-toast">
<Toast.Header />
<Toast.Body />
</Toast>,
).assertSingle('div.my-toast');
});
});

0 comments on commit 501b3bf

Please sign in to comment.