this shouldn't be in repo
This commit is contained in:
parent
2e70110597
commit
9bf19de533
1 changed files with 0 additions and 84 deletions
|
@ -1,84 +0,0 @@
|
|||
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')
|
||||
]
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue