Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
fix: fix ProgressCircular tests about diameter
Browse files Browse the repository at this point in the history
I don't know why but it seems that the scale is 0,25 instead of 0.25 on my Mac. So this fix repair the test in this case by replacing allowing comma in the scale match and replace it by a dot before cast it to float.
  • Loading branch information
Gregcop1 committed Mar 31, 2016
1 parent 3228292 commit 9c6ae37
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/components/progress_circular/progress_circular_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export function main() {
describe('diameter', () => {
it('should set scaling using percentage values', injectAsync([], () => {
return setup(`<md-progress-circular [diameter]="'25%'"></md-progress-circular>`).then((api: IProgressFixture) => {

let compiled = api.fixture.nativeElement;
let indicator = compiled.querySelector('md-progress-circular');
let scaleWrapper = compiled.querySelector('.md-scale-wrapper');
Expand Down Expand Up @@ -134,8 +133,8 @@ export function main() {
*/
function getScale(element) {
var transform = element.style['transform'] || element.style['-webkit-transform'];
var matches = /scale\(\s*([0-9\.]+)\s*\)/.exec(transform);
var scale = parseFloat(matches[1]);
var matches = /scale\(\s*([0-9,\.]+)\s*\)/.exec(transform);
var scale = parseFloat(matches[1].replace(',', '.'));

return Math.round(scale * 100) / 100;
}
Expand Down

0 comments on commit 9c6ae37

Please sign in to comment.