decide.nolog.cz/tests/pages/poll.js

19 lines
500 B
JavaScript
Raw Permalink Normal View History

import { create, isVisible, text } from 'ember-cli-page-object';
2018-12-29 20:35:04 +01:00
import { currentURL } from '@ember/test-helpers';
const urlMatches = function (regExp) {
return function () {
return regExp.test(currentURL());
};
};
export const definition = {
showsExpirationWarning: isVisible('.expiration-warning'),
url: text('.poll-link .link code'),
urlIsValid: urlMatches(
/^\/poll\/[a-zA-Z0-9]{10}\/participation\?encryptionKey=[a-zA-Z0-9]{40}$/,
),
};
export default create(definition);