open-vault/ui/tests/integration/components/radial-progress-test.js
Matthew Irish d93c92e4f5
UI - guard page redesign (#4779)
* add NavHeader component
* use NavHeader in SplashPage component and application.hbs
* let download button take a block
* add RadialProgress component
* use RadialProgress in ShamirFlow component
* style up the RadialProgress component
* update ember-basic-dropdown, ember-basic-dropdown-hover
* rework operation token generation workflow
* directly depend on ember-maybe-in-element
2018-06-26 16:35:47 -05:00

34 lines
1 KiB
JavaScript

import { moduleForComponent, test } from 'ember-qunit';
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);
moduleForComponent('radial-progress', 'Integration | Component | radial progress', {
integration: true,
beforeEach() {
component.setContext(this);
},
afterEach() {
component.removeContext();
},
});
test('it renders', function(assert) {
let circumference = 19 / 2 * Math.PI * 2;
this.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(component.strokeDash, circumference);
assert.equal(component.strokeDashOffset, circumference * 0.5);
});