Update dependency prettier to v3 (#668)
* Update dependency prettier to v3 * upgrade eslint-plugin-prettier and run prettier on all files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeldrik Hanschke <admin@jhanschke.de>
This commit is contained in:
parent
337944e56c
commit
98ff62af80
46 changed files with 436 additions and 410 deletions
|
@ -10,7 +10,7 @@ export default class BsForm extends BaseBsForm {
|
||||||
|
|
||||||
async validate(model) {
|
async validate(model) {
|
||||||
const isInvalid = Object.getOwnPropertyNames(
|
const isInvalid = Object.getOwnPropertyNames(
|
||||||
Object.getPrototypeOf(model)
|
Object.getPrototypeOf(model),
|
||||||
).any((potentialValidationKey) => {
|
).any((potentialValidationKey) => {
|
||||||
// Validation getters must be named `propertyValidation` by our convention
|
// Validation getters must be named `propertyValidation` by our convention
|
||||||
if (!potentialValidationKey.endsWith('Validation')) {
|
if (!potentialValidationKey.endsWith('Validation')) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default class CreateOptionsDates extends Component {
|
||||||
const dateAdded = newDatesAsLuxonDateTime.find((newDateAsLuxonDateTime) => {
|
const dateAdded = newDatesAsLuxonDateTime.find((newDateAsLuxonDateTime) => {
|
||||||
return !this.selectedDays.some(
|
return !this.selectedDays.some(
|
||||||
(selectedDay) =>
|
(selectedDay) =>
|
||||||
selectedDay.toISODate() === newDateAsLuxonDateTime.toISODate()
|
selectedDay.toISODate() === newDateAsLuxonDateTime.toISODate(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ export default class CreateOptionsDates extends Component {
|
||||||
[
|
[
|
||||||
...this.args.options.map(({ value }) => value),
|
...this.args.options.map(({ value }) => value),
|
||||||
dateAdded.toISODate(),
|
dateAdded.toISODate(),
|
||||||
].sort()
|
].sort(),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ export default class CreateOptionsDates extends Component {
|
||||||
const dateRemoved = this.selectedDays.find((selectedDay) => {
|
const dateRemoved = this.selectedDays.find((selectedDay) => {
|
||||||
return !newDatesAsLuxonDateTime.some(
|
return !newDatesAsLuxonDateTime.some(
|
||||||
(newDateAsLuxonDateTime) =>
|
(newDateAsLuxonDateTime) =>
|
||||||
newDateAsLuxonDateTime.toISODate() === selectedDay.toISODate()
|
newDateAsLuxonDateTime.toISODate() === selectedDay.toISODate(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -68,15 +68,15 @@ export default class CreateOptionsDates extends Component {
|
||||||
this.args.options
|
this.args.options
|
||||||
.filter(
|
.filter(
|
||||||
({ value }) =>
|
({ value }) =>
|
||||||
DateTime.fromISO(value).toISODate() !== dateRemoved.toISODate()
|
DateTime.fromISO(value).toISODate() !== dateRemoved.toISODate(),
|
||||||
)
|
)
|
||||||
.map(({ value }) => value)
|
.map(({ value }) => value),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'No date has been added or removed. This cannot be the case. Something spooky is going on.'
|
'No date has been added or removed. This cannot be the case. Something spooky is going on.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class FormDataOption {
|
||||||
const { isPartiallyFilled } = this;
|
const { isPartiallyFilled } = this;
|
||||||
if (isPartiallyFilled) {
|
if (isPartiallyFilled) {
|
||||||
return new IntlMessage(
|
return new IntlMessage(
|
||||||
'create.options-datetime.error.partiallyFilledTime'
|
'create.options-datetime.error.partiallyFilledTime',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class FormData {
|
||||||
this.options.splice(
|
this.options.splice(
|
||||||
position + 1,
|
position + 1,
|
||||||
0,
|
0,
|
||||||
new FormDataOption(this, { day, time: null })
|
new FormDataOption(this, { day, time: null }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class FormData {
|
||||||
const optionsForFirstDay = optionsGroupedByDay[firstDay];
|
const optionsForFirstDay = optionsGroupedByDay[firstDay];
|
||||||
|
|
||||||
const timesForFirstDayAreValid = optionsForFirstDay.every(
|
const timesForFirstDayAreValid = optionsForFirstDay.every(
|
||||||
(option) => option.isValid
|
(option) => option.isValid,
|
||||||
);
|
);
|
||||||
if (!timesForFirstDayAreValid) {
|
if (!timesForFirstDayAreValid) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -144,16 +144,16 @@ class FormData {
|
||||||
days
|
days
|
||||||
.map((day) =>
|
.map((day) =>
|
||||||
timesForFirstDay.map(
|
timesForFirstDay.map(
|
||||||
(time) => new FormDataOption(this, { day, time })
|
(time) => new FormDataOption(this, { day, time }),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
)
|
.flat(),
|
||||||
.flat()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.options = new TrackedArray(
|
this.options = new TrackedArray(
|
||||||
options.map(({ day, time }) => new FormDataOption(this, { day, time }))
|
options.map(({ day, time }) => new FormDataOption(this, { day, time })),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class FormData {
|
||||||
@action
|
@action
|
||||||
updateOptions(values) {
|
updateOptions(values) {
|
||||||
this.options = new TrackedArray(
|
this.options = new TrackedArray(
|
||||||
values.map((value) => new FormDataOption(this, value))
|
values.map((value) => new FormDataOption(this, value)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class FormData {
|
||||||
options.length === 0 && defaultOptionCount > 0 ? ['', ''] : options;
|
options.length === 0 && defaultOptionCount > 0 ? ['', ''] : options;
|
||||||
|
|
||||||
this.options = new TrackedArray(
|
this.options = new TrackedArray(
|
||||||
normalizedOptions.map(({ title }) => new FormDataOption(this, title))
|
normalizedOptions.map(({ title }) => new FormDataOption(this, title)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ export default class CreateOptionsComponent extends Component {
|
||||||
|
|
||||||
formData = new FormData(
|
formData = new FormData(
|
||||||
{ options: this.args.options },
|
{ options: this.args.options },
|
||||||
{ defaultOptionCount: this.args.isMakeAPoll ? 2 : 0 }
|
{ defaultOptionCount: this.args.isMakeAPoll ? 2 : 0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default class PollEvaluationParticipantsTable extends Component {
|
||||||
for (const option of poll.options.toArray()) {
|
for (const option of poll.options.toArray()) {
|
||||||
optionsPerDay.set(
|
optionsPerDay.set(
|
||||||
option.day,
|
option.day,
|
||||||
optionsPerDay.has(option.day) ? optionsPerDay.get(option.day) + 1 : 0
|
optionsPerDay.has(option.day) ? optionsPerDay.get(option.day) + 1 : 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ export default class PollEvaluationParticipantsTable extends Component {
|
||||||
Array.from(optionsPerDay.entries()).map(([dayString, count]) => [
|
Array.from(optionsPerDay.entries()).map(([dayString, count]) => [
|
||||||
DateTime.fromISO(dayString).toJSDate(),
|
DateTime.fromISO(dayString).toJSDate(),
|
||||||
count,
|
count,
|
||||||
])
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class CreateOptionsDatetimeController extends Controller {
|
||||||
updateOptions(options) {
|
updateOptions(options) {
|
||||||
this.model.options = options
|
this.model.options = options
|
||||||
.map(({ day, time }) =>
|
.map(({ day, time }) =>
|
||||||
time ? DateTime.fromISO(`${day}T${time}`).toISO() : day
|
time ? DateTime.fromISO(`${day}T${time}`).toISO() : day,
|
||||||
)
|
)
|
||||||
.sort()
|
.sort()
|
||||||
.map((isoString) => {
|
.map((isoString) => {
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default class CreateOptionsController extends Controller {
|
||||||
@action
|
@action
|
||||||
updateOptions(newOptions) {
|
updateOptions(newOptions) {
|
||||||
this.model.options = newOptions.map(({ value }) =>
|
this.model.options = newOptions.map(({ value }) =>
|
||||||
this.store.createFragment('option', { title: value })
|
this.store.createFragment('option', { title: value }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ export default class CreateSettings extends Controller {
|
||||||
) {
|
) {
|
||||||
this.set(
|
this.set(
|
||||||
'model.timezone',
|
'model.timezone',
|
||||||
Intl.DateTimeFormat().resolvedOptions().timeZone
|
Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ export default class PollController extends Controller {
|
||||||
// work-a-round for url not being updated
|
// work-a-round for url not being updated
|
||||||
window.location.hash = window.location.hash.replace(
|
window.location.hash = window.location.hash.replace(
|
||||||
this.encryptionKey,
|
this.encryptionKey,
|
||||||
this.encryption.key
|
this.encryption.key,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.set('encryptionKey', this.encryption.key);
|
this.set('encryptionKey', this.encryption.key);
|
||||||
|
|
|
@ -28,11 +28,11 @@ export function scrollFirstInvalidElementIntoViewPort() {
|
||||||
// delaying to next runloop therefore
|
// delaying to next runloop therefore
|
||||||
next(function () {
|
next(function () {
|
||||||
let invalidInput = document.querySelector(
|
let invalidInput = document.querySelector(
|
||||||
'.form-control.is-invalid, .custom-control-input.is-invalid'
|
'.form-control.is-invalid, .custom-control-input.is-invalid',
|
||||||
);
|
);
|
||||||
assert(
|
assert(
|
||||||
'Atleast one form control must be marked as invalid if form submission was rejected as invalid',
|
'Atleast one form control must be marked as invalid if form submission was rejected as invalid',
|
||||||
invalidInput
|
invalidInput,
|
||||||
);
|
);
|
||||||
|
|
||||||
// focus first invalid control
|
// focus first invalid control
|
||||||
|
@ -50,8 +50,8 @@ export function scrollFirstInvalidElementIntoViewPort() {
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
`label[for="${invalidInput.id.substr(
|
`label[for="${invalidInput.id.substr(
|
||||||
0,
|
0,
|
||||||
invalidInput.id.indexOf('_')
|
invalidInput.id.indexOf('_'),
|
||||||
)}"`
|
)}"`,
|
||||||
) ||
|
) ||
|
||||||
document.querySelector(`label[for="${invalidInput.id}"]`) ||
|
document.querySelector(`label[for="${invalidInput.id}"]`) ||
|
||||||
// For polls with type `MakeAPoll` the option inputs do not have a label at all. In that case
|
// For polls with type `MakeAPoll` the option inputs do not have a label at all. In that case
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
|
|
||||||
intl.set(
|
intl.set(
|
||||||
'locale',
|
'locale',
|
||||||
locale.includes('-') ? [locale, locale.split('-')[0]] : [locale]
|
locale.includes('-') ? [locale, locale.split('-')[0]] : [locale],
|
||||||
);
|
);
|
||||||
powerCalendar.set('local', locale);
|
powerCalendar.set('local', locale);
|
||||||
},
|
},
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default class Option extends Fragment {
|
||||||
set time(value) {
|
set time(value) {
|
||||||
assert(
|
assert(
|
||||||
'can not set a time if current value is not a valid date',
|
'can not set a time if current value is not a valid date',
|
||||||
this.isDate
|
this.isDate,
|
||||||
);
|
);
|
||||||
|
|
||||||
// set time to undefined if value is false
|
// set time to undefined if value is false
|
||||||
|
@ -70,7 +70,7 @@ export default class Option extends Fragment {
|
||||||
'title',
|
'title',
|
||||||
this.datetime
|
this.datetime
|
||||||
.set({ hours: datetime.hour, minutes: datetime.minute })
|
.set({ hours: datetime.hour, minutes: datetime.minute })
|
||||||
.toISO()
|
.toISO(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { modifier } from 'ember-modifier';
|
||||||
export default modifier(function autofocus(
|
export default modifier(function autofocus(
|
||||||
element,
|
element,
|
||||||
params,
|
params,
|
||||||
{ enabled = true }
|
{ enabled = true },
|
||||||
) {
|
) {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -11,7 +11,7 @@ class FormData {
|
||||||
|
|
||||||
if (!title) {
|
if (!title) {
|
||||||
return new IntlMessage(
|
return new IntlMessage(
|
||||||
'create.meta.input.title.validations.valueMissing'
|
'create.meta.input.title.validations.valueMissing',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class FormData {
|
||||||
this.nameIsRequired = nameIsRequired;
|
this.nameIsRequired = nameIsRequired;
|
||||||
this.namesTaken = namesTaken;
|
this.namesTaken = namesTaken;
|
||||||
this.selections = new TrackedArray(
|
this.selections = new TrackedArray(
|
||||||
options.map(() => new FormDataSelections(selectionIsRequired))
|
options.map(() => new FormDataSelections(selectionIsRequired)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { isEmpty } from '@ember/utils';
|
||||||
import ApplicationSerializer from './application';
|
import ApplicationSerializer from './application';
|
||||||
|
|
||||||
export default class PollSerializer extends ApplicationSerializer.extend(
|
export default class PollSerializer extends ApplicationSerializer.extend(
|
||||||
EmbeddedRecordsMixin
|
EmbeddedRecordsMixin,
|
||||||
) {
|
) {
|
||||||
attrs = {
|
attrs = {
|
||||||
users: {
|
users: {
|
||||||
|
|
|
@ -36,7 +36,7 @@ module.exports = {
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
targets.map((target) => {
|
targets.map((target) => {
|
||||||
return copy(`${apiPath}/${target}`, `${outputPath}/${target}`);
|
return copy(`${apiPath}/${target}`, `${outputPath}/${target}`);
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -52,7 +52,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default function (propertiesToEncrypt, model) {
|
||||||
assert('first argument must be an array', isArray(propertiesToEncrypt));
|
assert('first argument must be an array', isArray(propertiesToEncrypt));
|
||||||
assert(
|
assert(
|
||||||
"model must have an encryptionKey property which isn't empty",
|
"model must have an encryptionKey property which isn't empty",
|
||||||
isPresent(model.encryptionKey)
|
isPresent(model.encryptionKey),
|
||||||
);
|
);
|
||||||
|
|
||||||
let passphrase = model.encryptionKey;
|
let passphrase = model.encryptionKey;
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-ember": "^11.0.0",
|
"eslint-plugin-ember": "^11.0.0",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
"eslint-plugin-qunit": "^8.0.0",
|
"eslint-plugin-qunit": "^8.0.0",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"lerna-changelog": "^2.0.0",
|
"lerna-changelog": "^2.0.0",
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
"miragejs": "^0.1.47",
|
"miragejs": "^0.1.47",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"open-iconic": "^1.1.1",
|
"open-iconic": "^1.1.1",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^3.0.0",
|
||||||
"qunit": "^2.19.1",
|
"qunit": "^2.19.1",
|
||||||
"qunit-dom": "^3.0.0",
|
"qunit-dom": "^3.0.0",
|
||||||
"release-it": "^16.0.0",
|
"release-it": "^16.0.0",
|
||||||
|
|
|
@ -11,14 +11,14 @@ module('Acceptance | build', function (hooks) {
|
||||||
// head is not available through `find()`, `assert.dom()` or `this.element.querySelector()`
|
// head is not available through `find()`, `assert.dom()` or `this.element.querySelector()`
|
||||||
// cause they are scoped to `#ember-testing-container`.
|
// cause they are scoped to `#ember-testing-container`.
|
||||||
let buildInfoEl = document.head.querySelector(
|
let buildInfoEl = document.head.querySelector(
|
||||||
'head meta[name="build-info"]'
|
'head meta[name="build-info"]',
|
||||||
);
|
);
|
||||||
assert.ok(buildInfoEl, 'tag exists');
|
assert.ok(buildInfoEl, 'tag exists');
|
||||||
|
|
||||||
let content = buildInfoEl.content;
|
let content = buildInfoEl.content;
|
||||||
assert.ok(
|
assert.ok(
|
||||||
/^version=\d[\d.]+\d(-(alpha|beta|rc).\d)?(\+[\da-z]{8})?$/.test(content),
|
/^version=\d[\d.]+\d(-(alpha|beta|rc).\d)?(\+[\da-z]{8})?$/.test(content),
|
||||||
`${content} is valid version string`
|
`${content} is valid version string`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ module('Acceptance | build', function (hooks) {
|
||||||
// and therefore don't have access to head
|
// and therefore don't have access to head
|
||||||
assert.ok(
|
assert.ok(
|
||||||
document.head.querySelector('meta[http-equiv="Content-Security-Policy"]'),
|
document.head.querySelector('meta[http-equiv="Content-Security-Policy"]'),
|
||||||
'CSP meta tag exists'
|
'CSP meta tag exists',
|
||||||
);
|
);
|
||||||
|
|
||||||
// this only covers dynamically created elements not the ones defined in `app/index.html` cause
|
// this only covers dynamically created elements not the ones defined in `app/index.html` cause
|
||||||
|
@ -37,9 +37,9 @@ module('Acceptance | build', function (hooks) {
|
||||||
['link', 'script', 'style'].forEach((type) => {
|
['link', 'script', 'style'].forEach((type) => {
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
document.head.querySelector(
|
document.head.querySelector(
|
||||||
`${type} meta[http-equiv="Content-Security-Policy"]`
|
`${type} meta[http-equiv="Content-Security-Policy"]`,
|
||||||
),
|
),
|
||||||
'CSP meta tag does not have a silbing of type ${type}'
|
'CSP meta tag does not have a silbing of type ${type}',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -14,7 +14,7 @@ module('Acceptance | i18n', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.language-select').value,
|
find('.language-select').value,
|
||||||
'de',
|
'de',
|
||||||
'picks up locale in locale storage'
|
'picks up locale in locale storage',
|
||||||
);
|
);
|
||||||
|
|
||||||
await fillIn('.language-select', 'en');
|
await fillIn('.language-select', 'en');
|
||||||
|
@ -22,7 +22,7 @@ module('Acceptance | i18n', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
window.localStorage.getItem('locale'),
|
window.localStorage.getItem('locale'),
|
||||||
'en',
|
'en',
|
||||||
'persisted in localeStorage'
|
'persisted in localeStorage',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -101,7 +101,7 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
assert.equal(currentRouteName(), 'poll.participation');
|
assert.equal(currentRouteName(), 'poll.participation');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
[
|
[
|
||||||
Intl.DateTimeFormat('en-US', {
|
Intl.DateTimeFormat('en-US', {
|
||||||
|
@ -109,21 +109,21 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2015-12-24T17:00')),
|
}).format(new Date('2015-12-24T17:00')),
|
||||||
Intl.DateTimeFormat('en-US', { timeStyle: 'short' }).format(
|
Intl.DateTimeFormat('en-US', { timeStyle: 'short' }).format(
|
||||||
new Date('2015-12-24T19:00')
|
new Date('2015-12-24T19:00'),
|
||||||
),
|
),
|
||||||
Intl.DateTimeFormat('en-US', {
|
Intl.DateTimeFormat('en-US', {
|
||||||
dateStyle: 'full',
|
dateStyle: 'full',
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2015-12-31T22:59')),
|
}).format(new Date('2015-12-31T22:59')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
Array.from(
|
Array.from(
|
||||||
find('[data-test-form-element^="option"]').querySelectorAll(
|
find('[data-test-form-element^="option"]').querySelectorAll(
|
||||||
'.radio label'
|
'.radio label',
|
||||||
)
|
),
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
[yesLabel, maybeLabel, noLabel]
|
[yesLabel, maybeLabel, noLabel],
|
||||||
);
|
);
|
||||||
|
|
||||||
await switchTab('evaluation');
|
await switchTab('evaluation');
|
||||||
|
@ -131,13 +131,13 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Fritz Bauer'
|
'Fritz Bauer',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, noLabel, noLabel],
|
[yesLabel, noLabel, noLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
await switchTab('participation');
|
await switchTab('participation');
|
||||||
|
@ -148,13 +148,13 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
|
|
||||||
participant = PollEvaluationPage.participants.filterBy(
|
participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Hermann Langbein'
|
'Hermann Langbein',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, maybeLabel, yesLabel],
|
[yesLabel, maybeLabel, yesLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -193,9 +193,9 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
assert.equal(currentRouteName(), 'poll.participation');
|
assert.equal(currentRouteName(), 'poll.participation');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
['apple pie', 'pecan pie', 'plum pie']
|
['apple pie', 'pecan pie', 'plum pie'],
|
||||||
);
|
);
|
||||||
|
|
||||||
await switchTab('evaluation');
|
await switchTab('evaluation');
|
||||||
|
@ -203,13 +203,13 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Paul Levi'
|
'Paul Levi',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
['would be great!', 'no way', 'if I had to'],
|
['would be great!', 'no way', 'if I had to'],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
await switchTab('participation');
|
await switchTab('participation');
|
||||||
|
@ -224,13 +224,13 @@ module('Acceptance | legacy support', function (hooks) {
|
||||||
|
|
||||||
participant = PollEvaluationPage.participants.filterBy(
|
participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Hermann Langbein'
|
'Hermann Langbein',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
["I don't care", 'would be awesome', "can't imagine anything better"],
|
["I don't care", 'would be awesome', "can't imagine anything better"],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -41,7 +41,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll.participation',
|
'poll.participation',
|
||||||
'poll is redirected to poll.participation'
|
'poll is redirected to poll.participation',
|
||||||
);
|
);
|
||||||
|
|
||||||
await pollParticipate('Max Meiner', ['yes', 'no']);
|
await pollParticipate('Max Meiner', ['yes', 'no']);
|
||||||
|
@ -49,22 +49,22 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentURL().split('?')[1],
|
currentURL().split('?')[1],
|
||||||
`encryptionKey=${encryptionKey}`,
|
`encryptionKey=${encryptionKey}`,
|
||||||
'encryption key is part of query params'
|
'encryption key is part of query params',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
1,
|
1,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Max Meiner'
|
'Max Meiner',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, noLabel],
|
[yesLabel, noLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
await click('.nav .participation');
|
await click('.nav .participation');
|
||||||
|
@ -74,7 +74,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
findAll('input[type="radio"]')
|
findAll('input[type="radio"]')
|
||||||
.toArray()
|
.toArray()
|
||||||
.some((el) => el.checked),
|
.some((el) => el.checked),
|
||||||
'radios are cleared'
|
'radios are cleared',
|
||||||
);
|
);
|
||||||
|
|
||||||
await pollParticipate('Peter Müller', ['yes', 'yes']);
|
await pollParticipate('Peter Müller', ['yes', 'yes']);
|
||||||
|
@ -82,17 +82,17 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
2,
|
2,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
participant = PollEvaluationPage.participants.filterBy(
|
participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Peter Müller'
|
'Peter Müller',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, yesLabel],
|
[yesLabel, yesLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -112,18 +112,18 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
1,
|
1,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Max Manus'
|
'Max Manus',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
['answer 1', 'answer 2'],
|
['answer 1', 'answer 2'],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
assert.equal(currentRouteName(), 'poll.participation');
|
assert.equal(currentRouteName(), 'poll.participation');
|
||||||
|
|
||||||
|
@ -144,18 +144,18 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
1,
|
1,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'Karl Käfer'
|
'Karl Käfer',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, ''],
|
[yesLabel, ''],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
assert.equal(currentRouteName(), 'poll.participation');
|
assert.equal(currentRouteName(), 'poll.participation');
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
1,
|
1,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy('name', '')[0];
|
let participant = PollEvaluationPage.participants.filterBy('name', '')[0];
|
||||||
|
@ -184,7 +184,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, noLabel],
|
[yesLabel, noLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -197,13 +197,13 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
this.server.post('/users', undefined, 503);
|
this.server.post('/users', undefined, 503);
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
assert.equal(currentRouteName(), 'poll.participation');
|
assert.equal(currentRouteName(), 'poll.participation');
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-modal="saving-failed"] .modal-content')
|
.dom('[data-test-modal="saving-failed"] .modal-content')
|
||||||
.isNotVisible(
|
.isNotVisible(
|
||||||
'failed saving notification is not shown before attempt to save'
|
'failed saving notification is not shown before attempt to save',
|
||||||
);
|
);
|
||||||
|
|
||||||
await pollParticipate('John Doe', ['yes', 'no']);
|
await pollParticipate('John Doe', ['yes', 'no']);
|
||||||
|
@ -217,24 +217,24 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-modal="saving-failed"] .modal-content')
|
.dom('[data-test-modal="saving-failed"] .modal-content')
|
||||||
.isNotVisible(
|
.isNotVisible(
|
||||||
'Notification is hidden after another save attempt was successful'
|
'Notification is hidden after another save attempt was successful',
|
||||||
);
|
);
|
||||||
assert.equal(currentRouteName(), 'poll.evaluation');
|
assert.equal(currentRouteName(), 'poll.evaluation');
|
||||||
assert.equal(
|
assert.equal(
|
||||||
PollEvaluationPage.participants.length,
|
PollEvaluationPage.participants.length,
|
||||||
1,
|
1,
|
||||||
'user is added to participants table'
|
'user is added to participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
'John Doe'
|
'John Doe',
|
||||||
)[0];
|
)[0];
|
||||||
assert.ok(participant, 'user exists in participants table');
|
assert.ok(participant, 'user exists in participants table');
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
[yesLabel, noLabel],
|
[yesLabel, noLabel],
|
||||||
'participants table shows correct answers for new participant'
|
'participants table shows correct answers for new participant',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
pollParticipate('John Doe', ['yes', 'no']);
|
pollParticipate('John Doe', ['yes', 'no']);
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
assert.ok(
|
assert.ok(
|
||||||
true,
|
true,
|
||||||
'loading spinner shown cause otherwise there would have been a timeout'
|
'loading spinner shown cause otherwise there would have been a timeout',
|
||||||
);
|
);
|
||||||
|
|
||||||
// resolve promise for test to finish
|
// resolve promise for test to finish
|
||||||
|
@ -281,7 +281,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
await click('button[type="submit"]');
|
await click('button[type="submit"]');
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll.participation',
|
'poll.participation',
|
||||||
'invalid form prevents a transition'
|
'invalid form prevents a transition',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
await click('button[type="submit"]');
|
await click('button[type="submit"]');
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll.participation',
|
'poll.participation',
|
||||||
'invalid form prevents a transition'
|
'invalid form prevents a transition',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
await click('button[type="submit"]');
|
await click('button[type="submit"]');
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll.participation',
|
'poll.participation',
|
||||||
'invalid form prevents a transition'
|
'invalid form prevents a transition',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ module('Acceptance | participate in a poll', function (hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await visit(
|
await visit(
|
||||||
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`
|
`/poll/${poll.id}/participation?encryptionKey=${encryptionKey}`,
|
||||||
);
|
);
|
||||||
pollParticipate('John Doe', ['yes', 'no']);
|
pollParticipate('John Doe', ['yes', 'no']);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
||||||
0,
|
0,
|
||||||
'evaluation summary is not present'
|
'evaluation summary is not present',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -102,77 +102,77 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
||||||
1,
|
1,
|
||||||
'evaluation summary is present'
|
'evaluation summary is present',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.participants').textContent.trim(),
|
find('.participants').textContent.trim(),
|
||||||
t('poll.evaluation.participants', { count: 2 }).toString(),
|
t('poll.evaluation.participants', { count: 2 }).toString(),
|
||||||
'shows number of participants'
|
'shows number of participants',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.best-options strong').textContent.trim(),
|
find('.best-options strong').textContent.trim(),
|
||||||
'Friday, January 1, 2016',
|
'Friday, January 1, 2016',
|
||||||
'shows option most participants replied with yes to as best option'
|
'shows option most participants replied with yes to as best option',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.last-participation').textContent.trim(),
|
find('.last-participation').textContent.trim(),
|
||||||
t('poll.evaluation.lastParticipation', {
|
t('poll.evaluation.lastParticipation', {
|
||||||
ago: '3 months ago',
|
ago: '3 months ago',
|
||||||
}).toString(),
|
}).toString(),
|
||||||
'shows last participation date'
|
'shows last participation date',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll('table thead tr th').map((el) => el.textContent.trim()),
|
findAll('table thead tr th').map((el) => el.textContent.trim()),
|
||||||
['', 'Saturday, December 12, 2015', 'Friday, January 1, 2016'],
|
['', 'Saturday, December 12, 2015', 'Friday, January 1, 2016'],
|
||||||
'lists dates as table header of parcipants table'
|
'lists dates as table header of parcipants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-1"] [data-test-value-for="name"]')
|
.dom('[data-test-participant="1-1"] [data-test-value-for="name"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Maximilian',
|
'Maximilian',
|
||||||
'shows expected name of first participant in participants table'
|
'shows expected name of first participant in participants table',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-2"] [data-test-value-for="name"]')
|
.dom('[data-test-participant="1-2"] [data-test-value-for="name"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Peter',
|
'Peter',
|
||||||
'shows expected name of second participant in participants table'
|
'shows expected name of second participant in participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-1"] [data-test-value-for="2015-12-12"]')
|
.dom('[data-test-participant="1-1"] [data-test-value-for="2015-12-12"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for first option of first participant'
|
'shows expected selection for first option of first participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-1"] [data-test-value-for="2016-01-01"]')
|
.dom('[data-test-participant="1-1"] [data-test-value-for="2016-01-01"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for second option of first participant'
|
'shows expected selection for second option of first participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-2"] [data-test-value-for="2015-12-12"]')
|
.dom('[data-test-participant="1-2"] [data-test-value-for="2015-12-12"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'No',
|
'No',
|
||||||
'shows expected selection for first option of second participant'
|
'shows expected selection for first option of second participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-2"] [data-test-value-for="2016-01-01"]')
|
.dom('[data-test-participant="1-2"] [data-test-value-for="2016-01-01"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for second option of second participant'
|
'shows expected selection for second option of second participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll('[data-test-participant] [data-test-value-for="name"]').map(
|
findAll('[data-test-participant] [data-test-value-for="name"]').map(
|
||||||
(el) => el.textContent.trim()
|
(el) => el.textContent.trim(),
|
||||||
),
|
),
|
||||||
['Maximilian', 'Peter'],
|
['Maximilian', 'Peter'],
|
||||||
'Participants are ordered as correctly in participants table'
|
'Participants are ordered as correctly in participants table',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -260,122 +260,122 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
||||||
1,
|
1,
|
||||||
'evaluation summary is present'
|
'evaluation summary is present',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.participants').textContent.trim(),
|
find('.participants').textContent.trim(),
|
||||||
t('poll.evaluation.participants', { count: 2 }).toString(),
|
t('poll.evaluation.participants', { count: 2 }).toString(),
|
||||||
'shows number of participants'
|
'shows number of participants',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.best-options strong').textContent.trim(),
|
find('.best-options strong').textContent.trim(),
|
||||||
'Saturday, December 12, 2015 at 12:12 PM',
|
'Saturday, December 12, 2015 at 12:12 PM',
|
||||||
'shows option most participants replied with yes to as best option'
|
'shows option most participants replied with yes to as best option',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.last-participation').textContent.trim(),
|
find('.last-participation').textContent.trim(),
|
||||||
t('poll.evaluation.lastParticipation', {
|
t('poll.evaluation.lastParticipation', {
|
||||||
ago: '3 months ago',
|
ago: '3 months ago',
|
||||||
}).toString(),
|
}).toString(),
|
||||||
'shows last participation date'
|
'shows last participation date',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll('table thead tr:first-child th').map((el) =>
|
findAll('table thead tr:first-child th').map((el) =>
|
||||||
el.textContent.trim()
|
el.textContent.trim(),
|
||||||
),
|
),
|
||||||
['', 'Saturday, December 12, 2015', 'Friday, January 1, 2016'],
|
['', 'Saturday, December 12, 2015', 'Friday, January 1, 2016'],
|
||||||
'lists days as first row in table header of parcipants table'
|
'lists days as first row in table header of parcipants table',
|
||||||
);
|
);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll('table thead tr:last-child th').map((el) =>
|
findAll('table thead tr:last-child th').map((el) =>
|
||||||
el.textContent.trim()
|
el.textContent.trim(),
|
||||||
),
|
),
|
||||||
['', '6:06 AM', '12:12 PM', '6:18 PM'],
|
['', '6:06 AM', '12:12 PM', '6:18 PM'],
|
||||||
'lists times as second row in table header of parcipants table'
|
'lists times as second row in table header of parcipants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-1"] [data-test-value-for="name"]')
|
.dom('[data-test-participant="1-1"] [data-test-value-for="name"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Maximilian',
|
'Maximilian',
|
||||||
'shows expected name of first participant in participants table'
|
'shows expected name of first participant in participants table',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-participant="1-2"] [data-test-value-for="name"]')
|
.dom('[data-test-participant="1-2"] [data-test-value-for="name"]')
|
||||||
.hasText(
|
.hasText(
|
||||||
'Peter',
|
'Peter',
|
||||||
'shows expected name of second participant in participants table'
|
'shows expected name of second participant in participants table',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2015-12-12T06:06'
|
'2015-12-12T06:06',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for first option of first participant'
|
'shows expected selection for first option of first participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2015-12-12T12:12'
|
'2015-12-12T12:12',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for second option of first participant'
|
'shows expected selection for second option of first participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-1"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2016-01-01T18:18'
|
'2016-01-01T18:18',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'No',
|
'No',
|
||||||
'shows expected selection for third option of first participant'
|
'shows expected selection for third option of first participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2015-12-12T06:06'
|
'2015-12-12T06:06',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'No',
|
'No',
|
||||||
'shows expected selection for first option of second participant'
|
'shows expected selection for first option of second participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2015-12-12T12:12'
|
'2015-12-12T12:12',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for second option of second participant'
|
'shows expected selection for second option of second participant',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom(
|
.dom(
|
||||||
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
`[data-test-participant="1-2"] [data-test-value-for="${DateTime.fromISO(
|
||||||
'2016-01-01T18:18'
|
'2016-01-01T18:18',
|
||||||
).toISO()}"]`
|
).toISO()}"]`,
|
||||||
)
|
)
|
||||||
.hasText(
|
.hasText(
|
||||||
'Yes',
|
'Yes',
|
||||||
'shows expected selection for third option of second participant'
|
'shows expected selection for third option of second participant',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll('[data-test-participant] [data-test-value-for="name"]').map(
|
findAll('[data-test-participant] [data-test-value-for="name"]').map(
|
||||||
(el) => el.textContent.trim()
|
(el) => el.textContent.trim(),
|
||||||
),
|
),
|
||||||
['Maximilian', 'Peter'],
|
['Maximilian', 'Peter'],
|
||||||
'Participants are ordered as correctly in participants table'
|
'Participants are ordered as correctly in participants table',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
'poll',
|
'poll',
|
||||||
assign(pollData, {
|
assign(pollData, {
|
||||||
users: usersData.map((_) => this.server.create('user', _)),
|
users: usersData.map((_) => this.server.create('user', _)),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
await visit(`/poll/${poll.id}/evaluation?encryptionKey=${encryptionKey}`);
|
await visit(`/poll/${poll.id}/evaluation?encryptionKey=${encryptionKey}`);
|
||||||
|
@ -452,38 +452,38 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
findAll('.tab-content .tab-pane .evaluation-summary').length,
|
||||||
1,
|
1,
|
||||||
'evaluation summary is present'
|
'evaluation summary is present',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.participants').textContent.trim(),
|
find('.participants').textContent.trim(),
|
||||||
t('poll.evaluation.participants', { count: 2 }).toString(),
|
t('poll.evaluation.participants', { count: 2 }).toString(),
|
||||||
'participants are counted correctly'
|
'participants are counted correctly',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.best-options strong').textContent.trim(),
|
find('.best-options strong').textContent.trim(),
|
||||||
'second option',
|
'second option',
|
||||||
'options are evaluated correctly'
|
'options are evaluated correctly',
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
PollEvaluationPage.options.map((_) => _.label),
|
PollEvaluationPage.options.map((_) => _.label),
|
||||||
['first option', 'second option'],
|
['first option', 'second option'],
|
||||||
'dates are used as table headers'
|
'dates are used as table headers',
|
||||||
);
|
);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
PollEvaluationPage.participants.map((_) => _.name),
|
PollEvaluationPage.participants.map((_) => _.name),
|
||||||
usersData.map((_) => _.name),
|
usersData.map((_) => _.name),
|
||||||
'users are listed in participants table with their names'
|
'users are listed in participants table with their names',
|
||||||
);
|
);
|
||||||
usersData.forEach((user) => {
|
usersData.forEach((user) => {
|
||||||
let participant = PollEvaluationPage.participants.filterBy(
|
let participant = PollEvaluationPage.participants.filterBy(
|
||||||
'name',
|
'name',
|
||||||
user.name
|
user.name,
|
||||||
)[0];
|
)[0];
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
participant.selections.map((_) => _.answer),
|
participant.selections.map((_) => _.answer),
|
||||||
user.selections.map((_) => t(_.labelTranslation).toString()),
|
user.selections.map((_) => t(_.labelTranslation).toString()),
|
||||||
`answers are shown for user ${user.name} in participants table`
|
`answers are shown for user ${user.name} in participants table`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
t('poll.evaluation.lastParticipation', {
|
t('poll.evaluation.lastParticipation', {
|
||||||
ago: '3 days ago',
|
ago: '3 days ago',
|
||||||
}).toString(),
|
}).toString(),
|
||||||
'last participation is evaluated correctly'
|
'last participation is evaluated correctly',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ module('Acceptance | view evaluation', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.tab-pane h2').textContent.trim(),
|
find('.tab-pane h2').textContent.trim(),
|
||||||
t('poll.evaluation.label').toString(),
|
t('poll.evaluation.label').toString(),
|
||||||
'headline is there'
|
'headline is there',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,7 +30,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
pageParticipation.url,
|
pageParticipation.url,
|
||||||
window.location.href,
|
window.location.href,
|
||||||
'share link is shown'
|
'share link is shown',
|
||||||
);
|
);
|
||||||
|
|
||||||
await triggerCopySuccess();
|
await triggerCopySuccess();
|
||||||
|
@ -64,9 +64,9 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
await visit(`/poll/${poll.id}?encryptionKey=${encryptionKey}`);
|
await visit(`/poll/${poll.id}?encryptionKey=${encryptionKey}`);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
['Saturday, December 12, 2015', 'Friday, January 1, 2016']
|
['Saturday, December 12, 2015', 'Friday, January 1, 2016'],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
await visit(`/poll/${poll.id}?encryptionKey=${encryptionKey}`);
|
await visit(`/poll/${poll.id}?encryptionKey=${encryptionKey}`);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
[
|
[
|
||||||
// full date
|
// full date
|
||||||
|
@ -100,11 +100,11 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
'1:13 PM',
|
'1:13 PM',
|
||||||
// full date cause day changed
|
// full date cause day changed
|
||||||
'Friday, January 1, 2016 at 11:11 AM',
|
'Friday, January 1, 2016 at 11:11 AM',
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
pageParticipation.showsExpirationWarning,
|
pageParticipation.showsExpirationWarning,
|
||||||
'does not show an expiration warning if poll will not expire in next weeks'
|
'does not show an expiration warning if poll will not expire in next weeks',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -148,11 +148,11 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
.exists('user is asked which timezone should be used');
|
.exists('user is asked which timezone should be used');
|
||||||
|
|
||||||
await click(
|
await click(
|
||||||
'[data-test-modal="choose-timezone"] [data-test-button="use-local-timezone"]'
|
'[data-test-modal="choose-timezone"] [data-test-button="use-local-timezone"]',
|
||||||
);
|
);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
[
|
[
|
||||||
Intl.DateTimeFormat('en-US', {
|
Intl.DateTimeFormat('en-US', {
|
||||||
|
@ -163,7 +163,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
dateStyle: 'full',
|
dateStyle: 'full',
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2016-01-01T11:11:00.000Z')),
|
}).format(new Date('2016-01-01T11:11:00.000Z')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-modal="choose-timezone"]')
|
.dom('[data-test-modal="choose-timezone"]')
|
||||||
|
@ -177,7 +177,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
dateStyle: 'full',
|
dateStyle: 'full',
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2015-12-12T11:11:00.000Z')),
|
}).format(new Date('2015-12-12T11:11:00.000Z')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -221,11 +221,11 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
.exists('user is asked which timezone should be used');
|
.exists('user is asked which timezone should be used');
|
||||||
|
|
||||||
await click(
|
await click(
|
||||||
'[data-test-modal="choose-timezone"] [data-test-button="use-poll-timezone"]'
|
'[data-test-modal="choose-timezone"] [data-test-button="use-poll-timezone"]',
|
||||||
);
|
);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
findAll(
|
findAll(
|
||||||
`[data-test-form-element^="option"] label:not(.custom-control-label)`
|
`[data-test-form-element^="option"] label:not(.custom-control-label)`,
|
||||||
).map((el) => el.textContent.trim()),
|
).map((el) => el.textContent.trim()),
|
||||||
[
|
[
|
||||||
Intl.DateTimeFormat('en-US', {
|
Intl.DateTimeFormat('en-US', {
|
||||||
|
@ -238,7 +238,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
dateStyle: 'full',
|
dateStyle: 'full',
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2016-01-01T11:11:00.000Z')),
|
}).format(new Date('2016-01-01T11:11:00.000Z')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-modal="choose-timezone"]')
|
.dom('[data-test-modal="choose-timezone"]')
|
||||||
|
@ -253,7 +253,7 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
dateStyle: 'full',
|
dateStyle: 'full',
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
}).format(new Date('2015-12-12T11:11:00.000Z')),
|
}).format(new Date('2015-12-12T11:11:00.000Z')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -265,12 +265,12 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentURL(),
|
currentURL(),
|
||||||
`/poll/${pollId}?encryptionKey=${encryptionKey}`,
|
`/poll/${pollId}?encryptionKey=${encryptionKey}`,
|
||||||
'shows URL entered by user'
|
'shows URL entered by user',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll_error',
|
'poll_error',
|
||||||
'shows error substate of poll route'
|
'shows error substate of poll route',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-error-type]')
|
.dom('[data-test-error-type]')
|
||||||
|
@ -285,12 +285,12 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentURL(),
|
currentURL(),
|
||||||
`/poll/${poll.id}?encryptionKey=${encryptionKey}`,
|
`/poll/${poll.id}?encryptionKey=${encryptionKey}`,
|
||||||
'shows URL entered by user'
|
'shows URL entered by user',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll_error',
|
'poll_error',
|
||||||
'shows error substate of poll route'
|
'shows error substate of poll route',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-error-type]')
|
.dom('[data-test-error-type]')
|
||||||
|
@ -308,12 +308,12 @@ module('Acceptance | view poll', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentURL(),
|
currentURL(),
|
||||||
`/poll/${pollId}?encryptionKey=${encryptionKey}`,
|
`/poll/${pollId}?encryptionKey=${encryptionKey}`,
|
||||||
'shows URL entered by user'
|
'shows URL entered by user',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentRouteName(),
|
currentRouteName(),
|
||||||
'poll_error',
|
'poll_error',
|
||||||
'shows error substate of poll route'
|
'shows error substate of poll route',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('[data-test-error-type]')
|
.dom('[data-test-error-type]')
|
||||||
|
|
|
@ -12,7 +12,7 @@ function pollHasUser(assert, name, selections) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
elBase.querySelector(`td:nth-child(${index + 2})`).textContent.trim(),
|
elBase.querySelector(`td:nth-child(${index + 2})`).textContent.trim(),
|
||||||
selection.toString(),
|
selection.toString(),
|
||||||
`selection ${index} is as expected`
|
`selection ${index} is as expected`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,13 @@ export default async function (name, selections) {
|
||||||
`.participation .selections .form-group:nth-child(${
|
`.participation .selections .form-group:nth-child(${
|
||||||
index + 1
|
index + 1
|
||||||
}) input`,
|
}) input`,
|
||||||
selection
|
selection,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await click(
|
await click(
|
||||||
`.participation .selections .form-group:nth-child(${
|
`.participation .selections .form-group:nth-child(${
|
||||||
index + 1
|
index + 1
|
||||||
}) .${selection}.radio input`
|
}) .${selection}.radio input`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
this.store.createRecord('poll', {
|
this.store.createRecord('poll', {
|
||||||
pollType: 'FindADate',
|
pollType: 'FindADate',
|
||||||
options: [{ title: '2015-01-01' }],
|
options: [{ title: '2015-01-01' }],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
||||||
|
@ -38,12 +38,12 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group input').length,
|
findAll('.days .form-group input').length,
|
||||||
1,
|
1,
|
||||||
'there is one input field'
|
'there is one input field',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.days .form-group input').value,
|
find('.days .form-group input').value,
|
||||||
'',
|
'',
|
||||||
'value is an empty string'
|
'value is an empty string',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
this.store.createRecord('poll', {
|
this.store.createRecord('poll', {
|
||||||
pollType: 'FindADate',
|
pollType: 'FindADate',
|
||||||
options: [{ title: '2015-01-01T11:11:00.000Z' }],
|
options: [{ title: '2015-01-01T11:11:00.000Z' }],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
||||||
|
@ -66,12 +66,12 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group input').length,
|
findAll('.days .form-group input').length,
|
||||||
1,
|
1,
|
||||||
'there is one input field'
|
'there is one input field',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.days .form-group input').value,
|
find('.days .form-group input').value,
|
||||||
DateTime.fromISO('2015-01-01T11:11:00.000Z').toFormat('HH:mm'),
|
DateTime.fromISO('2015-01-01T11:11:00.000Z').toFormat('HH:mm'),
|
||||||
'it has time in option as value'
|
'it has time in option as value',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
{ title: DateTime.fromISO('2015-01-01T22:22').toISO() },
|
{ title: DateTime.fromISO('2015-01-01T22:22').toISO() },
|
||||||
{ title: '2015-02-02' },
|
{ title: '2015-02-02' },
|
||||||
],
|
],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
||||||
|
@ -98,30 +98,30 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days label').length,
|
findAll('.days label').length,
|
||||||
3,
|
3,
|
||||||
'every form-group has a label'
|
'every form-group has a label',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days label:not(.sr-only)').length,
|
findAll('.days label:not(.sr-only)').length,
|
||||||
2,
|
2,
|
||||||
'there are two not hidden labels for two different dates'
|
'there are two not hidden labels for two different dates',
|
||||||
);
|
);
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
findAll('.days .form-group')[0]
|
findAll('.days .form-group')[0]
|
||||||
.querySelector('label')
|
.querySelector('label')
|
||||||
.classList.contains('sr-only'),
|
.classList.contains('sr-only'),
|
||||||
'the first label is shown'
|
'the first label is shown',
|
||||||
);
|
);
|
||||||
assert.ok(
|
assert.ok(
|
||||||
findAll('.days .form-group')[1]
|
findAll('.days .form-group')[1]
|
||||||
.querySelector('label')
|
.querySelector('label')
|
||||||
.classList.contains('sr-only'),
|
.classList.contains('sr-only'),
|
||||||
'the repeated label on second form-group is hidden by sr-only class'
|
'the repeated label on second form-group is hidden by sr-only class',
|
||||||
);
|
);
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
findAll('.days .form-group')[2]
|
findAll('.days .form-group')[2]
|
||||||
.querySelector('label')
|
.querySelector('label')
|
||||||
.classList.contains('sr-only'),
|
.classList.contains('sr-only'),
|
||||||
'the new label on third form-group is shown'
|
'the new label on third form-group is shown',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
'poll',
|
'poll',
|
||||||
this.store.createRecord('poll', {
|
this.store.createRecord('poll', {
|
||||||
options: [{ title: '2015-01-01' }, { title: '2015-02-02' }],
|
options: [{ title: '2015-01-01' }, { title: '2015-02-02' }],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
||||||
|
@ -143,25 +143,25 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group input').length,
|
findAll('.days .form-group input').length,
|
||||||
2,
|
2,
|
||||||
'there are two input fields before'
|
'there are two input fields before',
|
||||||
);
|
);
|
||||||
|
|
||||||
await click(findAll('.days .form-group')[0].querySelector('.add'));
|
await click(findAll('.days .form-group')[0].querySelector('.add'));
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group input').length,
|
findAll('.days .form-group input').length,
|
||||||
3,
|
3,
|
||||||
'another input field is added'
|
'another input field is added',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group')[1].querySelector('label').textContent,
|
findAll('.days .form-group')[1].querySelector('label').textContent,
|
||||||
findAll('.days .form-group')[0].querySelector('label').textContent,
|
findAll('.days .form-group')[0].querySelector('label').textContent,
|
||||||
'new input has correct label'
|
'new input has correct label',
|
||||||
);
|
);
|
||||||
assert.ok(
|
assert.ok(
|
||||||
findAll('.days .form-group')[1]
|
findAll('.days .form-group')[1]
|
||||||
.querySelector('label')
|
.querySelector('label')
|
||||||
.classList.contains('sr-only'),
|
.classList.contains('sr-only'),
|
||||||
"label ofnew input is hidden cause it's repeated"
|
"label ofnew input is hidden cause it's repeated",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
{ title: DateTime.fromISO('2015-01-01T11:11').toISO() },
|
{ title: DateTime.fromISO('2015-01-01T11:11').toISO() },
|
||||||
{ title: DateTime.fromISO('2015-01-01T22:22').toISO() },
|
{ title: DateTime.fromISO('2015-01-01T22:22').toISO() },
|
||||||
],
|
],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
await render(hbs`<CreateOptionsDatetime @dates={{this.poll.options}} />`);
|
||||||
|
@ -187,23 +187,23 @@ module('Integration | Component | create options datetime', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days input').length,
|
findAll('.days input').length,
|
||||||
2,
|
2,
|
||||||
'there are two input fields before'
|
'there are two input fields before',
|
||||||
);
|
);
|
||||||
assert.ok(
|
assert.ok(
|
||||||
findAll('.delete').every((el) => el.disabled === false),
|
findAll('.delete').every((el) => el.disabled === false),
|
||||||
'options are deleteable'
|
'options are deleteable',
|
||||||
);
|
);
|
||||||
|
|
||||||
await click(findAll('.days .form-group')[0].querySelector('.delete'));
|
await click(findAll('.days .form-group')[0].querySelector('.delete'));
|
||||||
assert.equal(
|
assert.equal(
|
||||||
findAll('.days .form-group input').length,
|
findAll('.days .form-group input').length,
|
||||||
1,
|
1,
|
||||||
'one input field is removed after deletion'
|
'one input field is removed after deletion',
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.days .form-group input').value,
|
find('.days .form-group input').value,
|
||||||
'22:22',
|
'22:22',
|
||||||
'correct input field is deleted'
|
'correct input field is deleted',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -56,7 +56,7 @@ module('Integration | Component | create options', function (hooks) {
|
||||||
assert
|
assert
|
||||||
.dom('.form-group .invalid-feedback')
|
.dom('.form-group .invalid-feedback')
|
||||||
.doesNotExist(
|
.doesNotExist(
|
||||||
'there is no validation error anymore after a unique value is entered'
|
'there is no validation error anymore after a unique value is entered',
|
||||||
);
|
);
|
||||||
assert
|
assert
|
||||||
.dom('.form-group .is-invalid')
|
.dom('.form-group .is-invalid')
|
||||||
|
|
|
@ -9,7 +9,7 @@ module('Integration | Component | inline-datepicker', function (hooks) {
|
||||||
test('it renders an ember-power-calendar', async function (assert) {
|
test('it renders an ember-power-calendar', async function (assert) {
|
||||||
this.set('noop', () => {});
|
this.set('noop', () => {});
|
||||||
await render(
|
await render(
|
||||||
hbs`<InlineDatepicker @onCenterChange={{this.noop}} @onSelect={{this.noop}} />`
|
hbs`<InlineDatepicker @onCenterChange={{this.noop}} @onSelect={{this.noop}} />`,
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.dom('.ember-power-calendar').exists();
|
assert.dom('.ember-power-calendar').exists();
|
||||||
|
|
|
@ -16,5 +16,5 @@ module(
|
||||||
|
|
||||||
assert.equal(this.element.textContent.trim(), '1234');
|
assert.equal(this.element.textContent.trim(), '1234');
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,7 +17,7 @@ module('Integration | Mirage api mocking', function (hooks) {
|
||||||
assert.equal(JSON.parse(sjcl.decrypt(encryptionKey, poll.title)), 'foo');
|
assert.equal(JSON.parse(sjcl.decrypt(encryptionKey, poll.title)), 'foo');
|
||||||
assert.equal(
|
assert.equal(
|
||||||
JSON.parse(sjcl.decrypt(encryptionKey, poll.description)),
|
JSON.parse(sjcl.decrypt(encryptionKey, poll.description)),
|
||||||
'bar'
|
'bar',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ module('Integration | translations', function (hooks) {
|
||||||
intl.locales.forEach((locale) => {
|
intl.locales.forEach((locale) => {
|
||||||
assert.ok(
|
assert.ok(
|
||||||
Object.keys(localesMeta).includes(locale),
|
Object.keys(localesMeta).includes(locale),
|
||||||
`locales meta data is present for ${locale}`
|
`locales meta data is present for ${locale}`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,5 +11,5 @@ export default PageObject.create(
|
||||||
pollType: fillable('.poll-type select'),
|
pollType: fillable('.poll-type select'),
|
||||||
pollTypeHasFocus: hasFocus('.poll-type select'),
|
pollTypeHasFocus: hasFocus('.poll-type select'),
|
||||||
visit: visitable('/create'),
|
visit: visitable('/create'),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,5 +11,5 @@ export default PageObject.create(
|
||||||
description: fillable('.description textarea'),
|
description: fillable('.description textarea'),
|
||||||
title: fillable('.title input'),
|
title: fillable('.title input'),
|
||||||
titleHasFocus: hasFocus('.title input'),
|
titleHasFocus: hasFocus('.title input'),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,5 +20,5 @@ export default PageObject.create(
|
||||||
|
|
||||||
inputHasFocus: hasFocus('input'),
|
inputHasFocus: hasFocus('input'),
|
||||||
},
|
},
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,8 +25,8 @@ function selectDates(selector) {
|
||||||
dateOrDateTimes.every(
|
dateOrDateTimes.every(
|
||||||
(dateOrDateTime) =>
|
(dateOrDateTime) =>
|
||||||
dateOrDateTime instanceof Date ||
|
dateOrDateTime instanceof Date ||
|
||||||
DateTime.isDateTime(dateOrDateTime)
|
DateTime.isDateTime(dateOrDateTime),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (let i = 0; i < dateOrDateTimes.length; i++) {
|
for (let i = 0; i < dateOrDateTimes.length; i++) {
|
||||||
|
@ -57,5 +57,5 @@ export default create(
|
||||||
|
|
||||||
inputHasFocus: hasFocus('input'),
|
inputHasFocus: hasFocus('input'),
|
||||||
},
|
},
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,5 +12,5 @@ export default PageObject.create(
|
||||||
availableAnswersHasFocus: hasFocus('.answer-type select'),
|
availableAnswersHasFocus: hasFocus('.answer-type select'),
|
||||||
save: defaultsForCreate.next,
|
save: defaultsForCreate.next,
|
||||||
visit: visitable('/create/settings'),
|
visit: visitable('/create/settings'),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,7 +11,7 @@ export const definition = {
|
||||||
showsExpirationWarning: isVisible('.expiration-warning'),
|
showsExpirationWarning: isVisible('.expiration-warning'),
|
||||||
url: text('.poll-link .link code'),
|
url: text('.poll-link .link code'),
|
||||||
urlIsValid: urlMatches(
|
urlIsValid: urlMatches(
|
||||||
/^\/poll\/[a-zA-Z0-9]{10}\/participation\?encryptionKey=[a-zA-Z0-9]{40}$/
|
/^\/poll\/[a-zA-Z0-9]{10}\/participation\?encryptionKey=[a-zA-Z0-9]{40}$/,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default create(
|
||||||
'[data-test-table-of="participants"] thead tr:last-child th:not(:first-child)',
|
'[data-test-table-of="participants"] thead tr:last-child th:not(:first-child)',
|
||||||
{
|
{
|
||||||
label: text(''),
|
label: text(''),
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
participants: collection(
|
participants: collection(
|
||||||
'[data-test-table-of="participants"] [data-test-participant]',
|
'[data-test-table-of="participants"] [data-test-participant]',
|
||||||
|
@ -19,7 +19,7 @@ export default create(
|
||||||
answer: text(''),
|
answer: text(''),
|
||||||
option: attribute('data-test-value-for', ''),
|
option: attribute('data-test-value-for', ''),
|
||||||
}),
|
}),
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -18,5 +18,5 @@ export default PageObject.create(
|
||||||
title: text('h2.title'),
|
title: text('h2.title'),
|
||||||
// use as .visit({ encryptionKey: ??? })
|
// use as .visit({ encryptionKey: ??? })
|
||||||
visit: visitable('/poll/participation'),
|
visit: visitable('/poll/participation'),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,9 +11,9 @@ document.addEventListener(
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Content-Security-Policy violation detected: ' +
|
'Content-Security-Policy violation detected: ' +
|
||||||
`Violated directive: ${violatedDirective}. ` +
|
`Violated directive: ${violatedDirective}. ` +
|
||||||
`Blocked URI: ${blockedURI}`
|
`Blocked URI: ${blockedURI}`,
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
setApplication(Application.create(config.APP));
|
setApplication(Application.create(config.APP));
|
||||||
|
|
|
@ -13,25 +13,25 @@ module('Unit | Controller | poll', function (hooks) {
|
||||||
});
|
});
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
controller.get('showExpirationWarning'),
|
controller.get('showExpirationWarning'),
|
||||||
'is false if expirationDate is undefined'
|
'is false if expirationDate is undefined',
|
||||||
);
|
);
|
||||||
|
|
||||||
controller.set(
|
controller.set(
|
||||||
'model.expirationDate',
|
'model.expirationDate',
|
||||||
DateTime.local().plus({ weeks: 1 }).toISO()
|
DateTime.local().plus({ weeks: 1 }).toISO(),
|
||||||
);
|
);
|
||||||
assert.ok(
|
assert.ok(
|
||||||
controller.get('showExpirationWarning'),
|
controller.get('showExpirationWarning'),
|
||||||
'is true if expirationDate is less than 2 weeks in future'
|
'is true if expirationDate is less than 2 weeks in future',
|
||||||
);
|
);
|
||||||
|
|
||||||
controller.set(
|
controller.set(
|
||||||
'model.expirationDate',
|
'model.expirationDate',
|
||||||
DateTime.local().plus({ months: 1 }).toISO()
|
DateTime.local().plus({ months: 1 }).toISO(),
|
||||||
);
|
);
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
controller.get('showExpirationWarning'),
|
controller.get('showExpirationWarning'),
|
||||||
'is false if expirationDate is more than 2 weeks in future'
|
'is false if expirationDate is more than 2 weeks in future',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,12 +12,12 @@ module('Unit | Model | option', function (hooks) {
|
||||||
let option = run(() =>
|
let option = run(() =>
|
||||||
this.owner.lookup('service:store').createRecord('option', {
|
this.owner.lookup('service:store').createRecord('option', {
|
||||||
title: '2015-01-01',
|
title: '2015-01-01',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('day'),
|
option.get('day'),
|
||||||
'2015-01-01',
|
'2015-01-01',
|
||||||
'returns ISO 8601 day string if title is ISO 8601 day string'
|
'returns ISO 8601 day string if title is ISO 8601 day string',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -26,7 +26,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('day'),
|
option.get('day'),
|
||||||
DateTime.fromISO('2015-01-01T11:11:00.000Z').toISODate(),
|
DateTime.fromISO('2015-01-01T11:11:00.000Z').toISODate(),
|
||||||
'returns ISO 8601 day string if title is ISO 8601 datetime string'
|
'returns ISO 8601 day string if title is ISO 8601 datetime string',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -35,7 +35,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('day'),
|
option.get('day'),
|
||||||
undefined,
|
undefined,
|
||||||
'returns undefined if title is not a valid ISO 8601 string'
|
'returns undefined if title is not a valid ISO 8601 string',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -44,7 +44,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('day'),
|
option.get('day'),
|
||||||
undefined,
|
undefined,
|
||||||
'returns undefined if title is null'
|
'returns undefined if title is null',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
let option = run(() =>
|
let option = run(() =>
|
||||||
this.owner.lookup('service:store').createRecord('option', {
|
this.owner.lookup('service:store').createRecord('option', {
|
||||||
title: '2015-01-01T11:11:00.000Z',
|
title: '2015-01-01T11:11:00.000Z',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
assert.ok(option.get('hasTime'));
|
assert.ok(option.get('hasTime'));
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -69,12 +69,12 @@ module('Unit | Model | option', function (hooks) {
|
||||||
let option = run(() =>
|
let option = run(() =>
|
||||||
this.owner.lookup('service:store').createRecord('option', {
|
this.owner.lookup('service:store').createRecord('option', {
|
||||||
title: '2015-01-01T11:11:00.000Z',
|
title: '2015-01-01T11:11:00.000Z',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('time'),
|
option.get('time'),
|
||||||
DateTime.fromISO('2015-01-01T11:11:00.000Z').toFormat('HH:mm'),
|
DateTime.fromISO('2015-01-01T11:11:00.000Z').toFormat('HH:mm'),
|
||||||
'returns time if title is ISO 8601 datetime string'
|
'returns time if title is ISO 8601 datetime string',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -83,7 +83,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('time'),
|
option.get('time'),
|
||||||
undefined,
|
undefined,
|
||||||
'returns undefined if title is ISO 8601 day string'
|
'returns undefined if title is ISO 8601 day string',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -92,7 +92,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('time'),
|
option.get('time'),
|
||||||
undefined,
|
undefined,
|
||||||
'returns undefined if title is not an ISO 8601 date string'
|
'returns undefined if title is not an ISO 8601 date string',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
let option = run(() =>
|
let option = run(() =>
|
||||||
this.owner.lookup('service:store').createRecord('option', {
|
this.owner.lookup('service:store').createRecord('option', {
|
||||||
title: '2015-01-01',
|
title: '2015-01-01',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -109,7 +109,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('title'),
|
option.get('title'),
|
||||||
DateTime.fromISO('2015-01-01T11:00').toISO(),
|
DateTime.fromISO('2015-01-01T11:00').toISO(),
|
||||||
'sets title according to time'
|
'sets title according to time',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
@ -118,7 +118,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('title'),
|
option.get('title'),
|
||||||
'2015-01-01',
|
'2015-01-01',
|
||||||
'removes time from option if value is false'
|
'removes time from option if value is false',
|
||||||
);
|
);
|
||||||
|
|
||||||
const before = option.get('title');
|
const before = option.get('title');
|
||||||
|
@ -128,7 +128,7 @@ module('Unit | Model | option', function (hooks) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
option.get('title'),
|
option.get('title'),
|
||||||
before,
|
before,
|
||||||
'does not set title if time is invalid'
|
'does not set title if time is invalid',
|
||||||
);
|
);
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
|
40
yarn.lock
40
yarn.lock
|
@ -1763,6 +1763,18 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@octokit/openapi-types" "^18.0.0"
|
"@octokit/openapi-types" "^18.0.0"
|
||||||
|
|
||||||
|
"@pkgr/utils@^2.3.1":
|
||||||
|
version "2.4.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc"
|
||||||
|
integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==
|
||||||
|
dependencies:
|
||||||
|
cross-spawn "^7.0.3"
|
||||||
|
fast-glob "^3.3.0"
|
||||||
|
is-glob "^4.0.3"
|
||||||
|
open "^9.1.0"
|
||||||
|
picocolors "^1.0.0"
|
||||||
|
tslib "^2.6.0"
|
||||||
|
|
||||||
"@pnpm/config.env-replace@^1.1.0":
|
"@pnpm/config.env-replace@^1.1.0":
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c"
|
resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c"
|
||||||
|
@ -6780,12 +6792,13 @@ eslint-plugin-node@^11.1.0:
|
||||||
resolve "^1.10.1"
|
resolve "^1.10.1"
|
||||||
semver "^6.1.0"
|
semver "^6.1.0"
|
||||||
|
|
||||||
eslint-plugin-prettier@^4.0.0:
|
eslint-plugin-prettier@^5.0.1:
|
||||||
version "4.2.1"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz#a3b399f04378f79f066379f544e42d6b73f11515"
|
||||||
integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==
|
integrity sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==
|
||||||
dependencies:
|
dependencies:
|
||||||
prettier-linter-helpers "^1.0.0"
|
prettier-linter-helpers "^1.0.0"
|
||||||
|
synckit "^0.8.5"
|
||||||
|
|
||||||
eslint-plugin-qunit@^8.0.0:
|
eslint-plugin-qunit@^8.0.0:
|
||||||
version "8.0.1"
|
version "8.0.1"
|
||||||
|
@ -11047,7 +11060,7 @@ open-iconic@^1.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/open-iconic/-/open-iconic-1.1.1.tgz#9dcfc8c7cd3c61cdb4a236b1a347894c97adc0c6"
|
resolved "https://registry.yarnpkg.com/open-iconic/-/open-iconic-1.1.1.tgz#9dcfc8c7cd3c61cdb4a236b1a347894c97adc0c6"
|
||||||
integrity sha512-OQNnNMDxg4q+Kl4+8FT9l+7ZUS2fhDe39inzT1J/lQTmSmrOLI3Fkm/QHu0ro83mIfAhgM+F3ZpuHw8vomHCmQ==
|
integrity sha512-OQNnNMDxg4q+Kl4+8FT9l+7ZUS2fhDe39inzT1J/lQTmSmrOLI3Fkm/QHu0ro83mIfAhgM+F3ZpuHw8vomHCmQ==
|
||||||
|
|
||||||
open@9.1.0:
|
open@9.1.0, open@^9.1.0:
|
||||||
version "9.1.0"
|
version "9.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6"
|
resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6"
|
||||||
integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==
|
integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==
|
||||||
|
@ -11652,11 +11665,16 @@ prettier-linter-helpers@^1.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
fast-diff "^1.1.2"
|
fast-diff "^1.1.2"
|
||||||
|
|
||||||
prettier@^2.5.1, prettier@^2.6.2:
|
prettier@^2.5.1:
|
||||||
version "2.8.8"
|
version "2.8.8"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
|
||||||
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
||||||
|
|
||||||
|
prettier@^3.0.0:
|
||||||
|
version "3.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
|
||||||
|
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==
|
||||||
|
|
||||||
pretty-ms@^3.1.0:
|
pretty-ms@^3.1.0:
|
||||||
version "3.2.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.2.0.tgz#87a8feaf27fc18414d75441467d411d6e6098a25"
|
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.2.0.tgz#87a8feaf27fc18414d75441467d411d6e6098a25"
|
||||||
|
@ -13442,6 +13460,14 @@ sync-disk-cache@^2.0.0:
|
||||||
rimraf "^3.0.0"
|
rimraf "^3.0.0"
|
||||||
username-sync "^1.0.2"
|
username-sync "^1.0.2"
|
||||||
|
|
||||||
|
synckit@^0.8.5:
|
||||||
|
version "0.8.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3"
|
||||||
|
integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==
|
||||||
|
dependencies:
|
||||||
|
"@pkgr/utils" "^2.3.1"
|
||||||
|
tslib "^2.5.0"
|
||||||
|
|
||||||
tabbable@^5.3.3:
|
tabbable@^5.3.3:
|
||||||
version "5.3.3"
|
version "5.3.3"
|
||||||
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.3.3.tgz#aac0ff88c73b22d6c3c5a50b1586310006b47fbf"
|
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.3.3.tgz#aac0ff88c73b22d6c3c5a50b1586310006b47fbf"
|
||||||
|
@ -13809,7 +13835,7 @@ tslib@^1.9.0:
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||||
|
|
||||||
tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.1:
|
tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.1, tslib@^2.5.0, tslib@^2.6.0:
|
||||||
version "2.6.2"
|
version "2.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
|
||||||
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
|
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
|
||||||
|
|
Loading…
Reference in a new issue