open-nomad/ui/tests/pages/jobs/job/versions.js

25 lines
787 B
JavaScript
Raw Normal View History

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
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
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]'),
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
}),
error: error(),
2018-07-11 16:45:30 +00:00
});