01f9b6e61f
started replacing ember-easy-form-extensions by ember-form-master-2000 and ember-validations by ember-cp-validations using ember-form-master-2000 in old 0.2 release cause newer releases does not work with ember 0.12 should move to ember 2.x as soon as possible therefore ember-easy-form-extensions has to be dropped and ember-i18n been updated part of #76
84 lines
2.1 KiB
JavaScript
84 lines
2.1 KiB
JavaScript
import Ember from "ember";
|
|
import { module, test } from 'qunit';
|
|
import startApp from '../helpers/start-app';
|
|
import formattedDateHelper from 'croodle/helpers/formatted-date';
|
|
/* global moment */
|
|
/* jshint proto: true */
|
|
|
|
var application, server;
|
|
|
|
module('Integration', {
|
|
beforeEach: function() {
|
|
application = startApp();
|
|
},
|
|
afterEach: function() {
|
|
Ember.run(application, 'destroy');
|
|
}
|
|
});
|
|
|
|
test("create a default poll and participate", function(assert) {
|
|
var dates =
|
|
[
|
|
moment().add(1, 'day'),
|
|
moment().add(1, 'week'),
|
|
moment().add(1, 'month')
|
|
];
|
|
|
|
var formattedDates =
|
|
dates.map((date) => {
|
|
return date.format(
|
|
moment.localeData().longDateFormat('LLLL')
|
|
.replace(
|
|
moment.localeData().longDateFormat('LT'), '')
|
|
.trim()
|
|
);
|
|
});
|
|
|
|
visit('/create').then(function() {
|
|
click('.button-next');
|
|
|
|
andThen(function(){
|
|
assert.equal(currentPath(), 'create.meta');
|
|
|
|
fillIn('input[name="model.title"]', 'default poll');
|
|
click('.button-next');
|
|
|
|
andThen(function(){
|
|
assert.equal(currentPath(), 'create.options');
|
|
|
|
selectDates('#datepicker .ember-view', dates);
|
|
|
|
click('.button-next');
|
|
|
|
andThen(function(){
|
|
assert.equal(currentPath(), 'create.settings');
|
|
|
|
click('.button-next');
|
|
|
|
andThen(function(){
|
|
assert.equal(currentPath(), 'poll.participation');
|
|
|
|
pollTitleEqual(assert, 'default poll');
|
|
pollDescriptionEqual(assert, '');
|
|
pollHasOptions(formattedDates);
|
|
pollHasUsersCount(assert, 0);
|
|
pollParticipate('Max Hoelz', ['no', 'no', 'yes']);
|
|
andThen(function(){
|
|
assert.equal(currentPath(), 'poll.evaluation');
|
|
pollHasUsersCount(assert, 1);
|
|
pollHasUser(
|
|
assert,
|
|
'Max Hoelz',
|
|
[
|
|
Ember.I18n.t('answerTypes.no.label'),
|
|
Ember.I18n.t('answerTypes.no.label'),
|
|
Ember.I18n.t('answerTypes.yes.label')
|
|
]
|
|
);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|