mirror of
https://github.com/kevinsqi/react-circular-progressbar.git
synced 2026-01-25 16:03:15 +00:00
add text prop tests
This commit is contained in:
parent
768d8c44fb
commit
c2f459a996
@ -38,6 +38,26 @@ describe('CircularProgressbar props', () => {
|
||||
assert(wrapper.find('svg').prop('className').includes('my-custom-class'));
|
||||
});
|
||||
|
||||
it('text does not render when null', () => {
|
||||
const wrapper = shallow(
|
||||
<CircularProgressbar
|
||||
percentage={50}
|
||||
/>
|
||||
);
|
||||
assert(!wrapper.find('.CircularProgressbar-text').exists());
|
||||
});
|
||||
|
||||
it('text', () => {
|
||||
const percentage = 50;
|
||||
const wrapper = shallow(
|
||||
<CircularProgressbar
|
||||
percentage={percentage}
|
||||
text={`${percentage}%`}
|
||||
/>
|
||||
);
|
||||
assert.equal(wrapper.find('.CircularProgressbar-text').text(), '50%');
|
||||
});
|
||||
|
||||
it('percentage', () => {
|
||||
const percentage = 30;
|
||||
const wrapper = shallow(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user