2016-08-14 22:24:04 +02:00
|
|
|
import PageObject from 'ember-cli-page-object';
|
2017-08-26 02:14:09 +02:00
|
|
|
import { definition as Poll } from 'croodle/tests/pages/poll';
|
2016-08-21 14:31:39 +02:00
|
|
|
import { defaultsForApplication } from 'croodle/tests/pages/defaults';
|
2016-08-26 00:36:41 +02:00
|
|
|
import { hasFocus } from 'croodle/tests/pages/helpers';
|
2016-04-08 21:48:22 +02:00
|
|
|
|
|
|
|
let {
|
|
|
|
collection,
|
2016-08-26 00:36:41 +02:00
|
|
|
fillable,
|
2016-04-08 21:48:22 +02:00
|
|
|
text,
|
|
|
|
visitable
|
|
|
|
} = PageObject;
|
|
|
|
|
2016-08-21 14:31:39 +02:00
|
|
|
const { assign } = Object;
|
|
|
|
|
2017-08-26 02:14:09 +02:00
|
|
|
export default PageObject.create(assign({}, defaultsForApplication, Poll, {
|
2016-04-08 21:48:22 +02:00
|
|
|
description: text('.description'),
|
2016-08-26 00:36:41 +02:00
|
|
|
name: fillable('.name input'),
|
|
|
|
nameHasFocus: hasFocus('.name input'),
|
2016-04-08 21:48:22 +02:00
|
|
|
options: collection({
|
|
|
|
answers: text('.selections .form-group:eq(0) .radio', { multiple: true }),
|
|
|
|
itemScope: '.selections .form-group',
|
|
|
|
item: {
|
2019-06-07 11:22:13 +02:00
|
|
|
label: text('label')
|
2016-04-08 21:48:22 +02:00
|
|
|
},
|
2019-06-07 11:22:13 +02:00
|
|
|
labels: text('.selections .form-group > label', { multiple: true })
|
2016-04-08 21:48:22 +02:00
|
|
|
}),
|
|
|
|
title: text('h2.title'),
|
|
|
|
// use as .visit({ encryptionKey: ??? })
|
|
|
|
visit: visitable('/poll/participation')
|
2016-08-21 14:31:39 +02:00
|
|
|
}));
|