2018-07-11 17:36:33 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
clickable,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
fillable,
|
|
|
|
isPresent,
|
|
|
|
text,
|
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
2018-07-24 02:06:41 +00:00
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
2018-11-05 23:42:04 +00:00
|
|
|
import error from 'nomad-ui/tests/pages/components/error';
|
2020-04-02 22:52:44 +00:00
|
|
|
import pageSizeSelect from 'nomad-ui/tests/pages/components/page-size-select';
|
2020-04-30 13:15:19 +00:00
|
|
|
import LifecycleChart from 'nomad-ui/tests/pages/components/lifecycle-chart';
|
2018-07-24 02:06:41 +00:00
|
|
|
|
2018-07-11 17:36:33 +00:00
|
|
|
export default create({
|
2020-04-01 00:13:44 +00:00
|
|
|
pageSize: 25,
|
2018-07-11 17:36:33 +00:00
|
|
|
|
|
|
|
visit: visitable('/jobs/:id/:name'),
|
|
|
|
|
|
|
|
search: fillable('.search-box input'),
|
|
|
|
|
|
|
|
tasksCount: text('[data-test-task-group-tasks]'),
|
|
|
|
cpu: text('[data-test-task-group-cpu]'),
|
|
|
|
mem: text('[data-test-task-group-mem]'),
|
|
|
|
disk: text('[data-test-task-group-disk]'),
|
|
|
|
|
|
|
|
breadcrumbs: collection('[data-test-breadcrumb]', {
|
|
|
|
id: attribute('data-test-breadcrumb'),
|
|
|
|
text: text(),
|
|
|
|
visit: clickable(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
breadcrumbFor(id) {
|
|
|
|
return this.breadcrumbs.toArray().find(crumb => crumb.id === id);
|
|
|
|
},
|
|
|
|
|
2018-07-24 02:06:41 +00:00
|
|
|
...allocations(),
|
2018-07-11 17:36:33 +00:00
|
|
|
|
|
|
|
isEmpty: isPresent('[data-test-empty-allocations-list]'),
|
|
|
|
|
2020-04-30 13:15:19 +00:00
|
|
|
lifecycleChart: LifecycleChart,
|
|
|
|
|
2020-02-14 00:44:41 +00:00
|
|
|
hasVolumes: isPresent('[data-test-volumes]'),
|
|
|
|
volumes: collection('[data-test-volumes] [data-test-volume]', {
|
|
|
|
name: text('[data-test-volume-name]'),
|
|
|
|
type: text('[data-test-volume-type]'),
|
|
|
|
source: text('[data-test-volume-source]'),
|
|
|
|
permissions: text('[data-test-volume-permissions]'),
|
|
|
|
}),
|
|
|
|
|
2018-11-05 23:42:04 +00:00
|
|
|
error: error(),
|
2018-11-03 01:24:33 +00:00
|
|
|
|
2018-07-11 17:36:33 +00:00
|
|
|
emptyState: {
|
|
|
|
headline: text('[data-test-empty-allocations-list-headline]'),
|
|
|
|
},
|
2020-04-01 00:13:44 +00:00
|
|
|
|
2020-04-02 22:52:44 +00:00
|
|
|
pageSizeSelect: pageSizeSelect(),
|
2018-07-11 17:36:33 +00:00
|
|
|
});
|