2018-12-29 20:35:04 +01:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render } from '@ember/test-helpers';
|
2016-03-17 13:32:53 +01:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
import moment from 'moment';
|
|
|
|
|
2018-12-29 20:35:04 +01:00
|
|
|
module('Integration | Component | poll evaluation chart', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
|
|
|
hooks.beforeEach(function() {
|
2016-03-17 13:32:53 +01:00
|
|
|
moment.locale('en');
|
2018-12-29 20:35:04 +01:00
|
|
|
});
|
2016-03-17 13:32:53 +01:00
|
|
|
|
2018-12-29 20:35:04 +01:00
|
|
|
test('it renders', async function(assert) {
|
2019-04-20 23:29:59 +02:00
|
|
|
this.set('poll', {
|
|
|
|
answerType: 'YesNoMaybe',
|
|
|
|
options: [
|
|
|
|
{ title: '2015-01-01' },
|
|
|
|
],
|
|
|
|
users: [
|
|
|
|
{ selections: [{ type: 'yes' }]},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
await render(hbs`{{poll-evaluation-chart poll=poll}}`);
|
|
|
|
|
2019-01-18 19:59:21 +01:00
|
|
|
assert.dom('canvas').exists('it renders a canvas element');
|
2018-12-29 20:35:04 +01:00
|
|
|
});
|
2016-03-17 13:32:53 +01:00
|
|
|
});
|