682e6a658e
> helpers/poll-has-users.js should pass jscs. > requireSemicolons: Missing semicolon after statement at helpers/poll-has-users.js is incostitent with JSHint which complains about this semicolon other ones should be fixed by rewrite of create/options
17 lines
518 B
JavaScript
17 lines
518 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Test.registerHelper('pollHasAnswers', function(app, assert, answers) {
|
|
const [ elBase ] = find('.participation .selections .form-group');
|
|
assert.equal(
|
|
find('.radio label', elBase).length,
|
|
answers.length,
|
|
'poll has expected count of answers'
|
|
);
|
|
answers.forEach((answer, index) => {
|
|
assert.equal(
|
|
find(`.radio:nth-child(${index + 1}) label`, elBase).text().trim(),
|
|
answer,
|
|
`poll answer ${index} is as expected`
|
|
);
|
|
});
|
|
});
|