mirror of
https://github.com/kevinsqi/react-circular-progressbar.git
synced 2026-01-18 15:55:06 +00:00
Merge pull request #60 from iqnivek/fix-root-style-hook
Use styles.root properly
This commit is contained in:
commit
415ff376e1
@ -103,6 +103,7 @@ class CircularProgressbar extends React.Component {
|
||||
return (
|
||||
<svg
|
||||
className={`${classes.root} ${className} ${classForPercentage}`}
|
||||
style={styles.root}
|
||||
viewBox={`0 0 ${MAX_X} ${MAX_Y}`}
|
||||
>
|
||||
{
|
||||
|
||||
@ -119,15 +119,35 @@ describe('CircularProgressbar props', () => {
|
||||
const wrapper = shallow(
|
||||
<CircularProgressbar
|
||||
percentage={50}
|
||||
background
|
||||
styles={{
|
||||
path: { stroke: '#ffffff' },
|
||||
root: { stroke: '#000000' },
|
||||
trail: { stroke: '#111111' },
|
||||
path: { stroke: '#222222' },
|
||||
text: { stroke: '#333333' },
|
||||
background: { stroke: '#444444' },
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
wrapper.find('.CircularProgressbar').prop('style').stroke,
|
||||
'#000000',
|
||||
);
|
||||
assert.equal(
|
||||
wrapper.find('.CircularProgressbar-trail').prop('style').stroke,
|
||||
'#111111',
|
||||
);
|
||||
assert.equal(
|
||||
wrapper.find('.CircularProgressbar-path').prop('style').stroke,
|
||||
'#ffffff',
|
||||
'#222222',
|
||||
);
|
||||
assert.equal(
|
||||
wrapper.find('.CircularProgressbar-text').prop('style').stroke,
|
||||
'#333333',
|
||||
);
|
||||
assert.equal(
|
||||
wrapper.find('.CircularProgressbar-background').prop('style').stroke,
|
||||
'#444444',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user