decide.nolog.cz/tests/integration/components/poll-evaluation-chart-test.js

29 lines
749 B
JavaScript
Raw Normal View History

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) {
this.set('poll', {
answerType: 'YesNoMaybe',
options: [
{ title: '2015-01-01' },
],
users: [
{ selections: [{ type: 'yes' }]},
],
});
await render(hbs`{{poll-evaluation-chart poll=poll}}`);
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
});