2021-04-20 13:33:16 +00:00
|
|
|
import { attribute, create, collection, text, visitable } from 'ember-cli-page-object';
|
|
|
|
import { getter } from 'ember-cli-page-object/macros';
|
2018-07-11 16:45:30 +00:00
|
|
|
|
2021-04-20 13:33:16 +00:00
|
|
|
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
2018-11-05 23:42:04 +00:00
|
|
|
import error from 'nomad-ui/tests/pages/components/error';
|
|
|
|
|
2018-07-11 16:45:30 +00:00
|
|
|
export default create({
|
|
|
|
visit: visitable('/jobs/:id/versions'),
|
|
|
|
|
|
|
|
versions: collection('[data-test-version]', {
|
|
|
|
text: text(),
|
|
|
|
stability: text('[data-test-version-stability]'),
|
|
|
|
submitTime: text('[data-test-version-submit-time]'),
|
2021-04-20 13:33:16 +00:00
|
|
|
|
|
|
|
revertToButton: twoStepButton('[data-test-revert-to]'),
|
|
|
|
revertToButtonIsDisabled: attribute('disabled', '[data-test-revert-to]'),
|
|
|
|
|
|
|
|
number: getter(function() {
|
|
|
|
return parseInt(this.text.match(/#(\d+)/)[1]);
|
|
|
|
}),
|
2018-07-11 16:45:30 +00:00
|
|
|
}),
|
2018-11-05 23:42:04 +00:00
|
|
|
|
|
|
|
error: error(),
|
2018-07-11 16:45:30 +00:00
|
|
|
});
|