Skip to content

Commit

Permalink
feat(sifrr-progress-round): update to use sifrr-dom 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
aadityataparia committed Nov 2, 2019
1 parent fb4112c commit d4b3c6c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 34 deletions.
2 changes: 1 addition & 1 deletion elements/sifrr-carousel/src/sifrrcarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const template = SifrrDom.template`<style media="screen">
<div class="arrow r">
<span></span>
</div>
<sifrr-tab-header options='{ "showUnderline": false }'>
<sifrr-tab-header :options="\${{ showUnderline: false }}">
<slot name="preview"></slot>
</sifrr-tab-header>
</div>`;
Expand Down
7 changes: 1 addition & 6 deletions elements/sifrr-progress-round/src/sifrrprogressround.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ class SifrrProgressRound extends SifrrDom.Element {
}

onPropsChange(props) {
if (['progress', 'stroke', 'stroke-width'].filter(p => props.indexOf(p) > -1).length > 0)
if (['progress', 'stroke', 'strokeWidth'].filter(p => props.indexOf(p) > -1).length > 0)
this.update();
}
}

SifrrProgressRound.defaultState = {
progress: 0,
'stroke-width': 2,
stroke: '#fff'
};
SifrrDom.register(SifrrProgressRound);

export default SifrrProgressRound;
8 changes: 4 additions & 4 deletions elements/sifrr-progress-round/src/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
r="28"
fill="none"
stroke="rgba(255, 255, 255, 0.6)"
stroke-width="${this['stroke-width']}"
stroke-width="${this.strokeWidth || 2}"
/>
<circle
id="top"
cx="30"
cy="30"
r="28"
fill="none"
stroke="${this.stroke}"
stroke-width="${this['stroke-width']}"
stroke="${this.stroke || '#fff'}"
stroke-width="${this.strokeWidth || 2}"
stroke-dasharray="188.5"
stroke-dashoffset="${(100 - this.progress) / 100 * 188.5}"
stroke-dashoffset="${(100 - (this.progress || 0)) / 100 * 188.5}"
/>
</svg>
4 changes: 2 additions & 2 deletions elements/sifrr-progress-round/test/browser/progress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ describe('shows correct progress', () => {
});

it('has correct progress after setting', async () => {
await page.$eval('sifrr-progress-round', el => (el.state = { progress: 10 }));
await page.$eval('sifrr-progress-round', el => el.setProp('progress', 10));
assert.equal(await getProgress(), 90);

await page.$eval('sifrr-progress-round', el => (el.state = { progress: 70 }));
await page.$eval('sifrr-progress-round', el => el.setProp('progress', 70));
assert.equal(await getProgress(), 30);
});
});
21 changes: 0 additions & 21 deletions elements/sifrr-progress-round/test/browser/state.test.js

This file was deleted.

0 comments on commit d4b3c6c

Please sign in to comment.