consul/ui-v2/tests/lib/page-object/createSubmitable.js

15 lines
321 B
JavaScript
Raw Normal View History

2018-07-04 14:06:20 +00:00
export default function(clickable, is) {
return function(obj, scope = '') {
if (scope !== '') {
scope = scope + ' ';
}
2018-07-04 14:06:20 +00:00
return {
...obj,
...{
submit: clickable(scope + '[type=submit]'),
submitIsEnabled: is(':not(:disabled)', scope + '[type=submit]'),
2018-07-04 14:06:20 +00:00
},
};
};
}