vault/ui/tests/integration/components/radial-progress-test.js
Noelle Daley e9b5056a1b
Add Browserstack for IE11 testing (#6557)
* add browserstack

* check for data before removing root token

* fix root prefix and select by attributes for ie11

* use objectAt for ie11

* use blobs instead of files for ie11

* manually round cirucmference for ie11

* skip csp test on ie11

* skip tests in ie11

* include polyfill for CI

* remove on exit hooks

* update which browserstack tests are run

* remove ie check since we are not running these tests in ie

* remove ie check since we are not running these tests in ie
2019-05-03 15:20:14 -07:00

38 lines
1.4 KiB
JavaScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { create } from 'ember-cli-page-object';
import hbs from 'htmlbars-inline-precompile';
import radialProgress from 'vault/tests/pages/components/radial-progress';
const component = create(radialProgress);
module('Integration | Component | radial progress', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
component.setContext(this);
});
hooks.afterEach(function() {
component.removeContext();
});
test('it renders', async function(assert) {
// We have to manually round the circumference, strokeDash, and strokeDashOffset because
// ie11 truncates decimals differently than other browsers.
let circumference = ((19 / 2) * Math.PI * 2).toFixed(2);
await render(hbs`{{radial-progress progressDecimal=0.5}}`);
assert.equal(component.viewBox, '0 0 20 20');
assert.equal(component.height, '20');
assert.equal(component.width, '20');
assert.equal(component.strokeWidth, '1');
assert.equal(component.r, 19 / 2);
assert.equal(component.cx, 10);
assert.equal(component.cy, 10);
assert.equal(Number(component.strokeDash).toFixed(2), circumference);
assert.equal(Number(component.strokeDashOffset).toFixed(3), (circumference * 0.5).toFixed(3));
});
});