2018-07-24 04:54:23 +00:00
|
|
|
import {
|
|
|
|
attribute,
|
|
|
|
clickable,
|
|
|
|
create,
|
|
|
|
collection,
|
|
|
|
fillable,
|
2018-07-30 19:56:42 +00:00
|
|
|
isPresent,
|
|
|
|
text,
|
2018-07-24 04:54:23 +00:00
|
|
|
visitable,
|
|
|
|
} from 'ember-cli-page-object';
|
|
|
|
|
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
2018-11-06 00:06:08 +00:00
|
|
|
import error from 'nomad-ui/tests/pages/components/error';
|
2021-12-18 00:49:05 +00:00
|
|
|
import { multiFacet } from 'nomad-ui/tests/pages/components/facet';
|
2018-07-24 04:54:23 +00:00
|
|
|
|
|
|
|
export default create({
|
|
|
|
visit: visitable('/jobs/:id/allocations'),
|
|
|
|
|
|
|
|
pageSize: 25,
|
|
|
|
|
2018-07-30 19:56:42 +00:00
|
|
|
hasSearchBox: isPresent('[data-test-allocations-search]'),
|
2018-07-24 04:54:23 +00:00
|
|
|
search: fillable('[data-test-allocations-search] input'),
|
|
|
|
|
|
|
|
...allocations(),
|
|
|
|
|
2021-12-18 00:49:05 +00:00
|
|
|
facets: {
|
|
|
|
status: multiFacet('[data-test-allocation-status-facet]'),
|
|
|
|
client: multiFacet('[data-test-allocation-client-facet]'),
|
|
|
|
taskGroup: multiFacet('[data-test-allocation-task-group-facet]'),
|
|
|
|
},
|
|
|
|
|
2018-07-30 19:56:42 +00:00
|
|
|
isEmpty: isPresent('[data-test-empty-allocations-list]'),
|
|
|
|
emptyState: {
|
|
|
|
headline: text('[data-test-empty-allocations-list-headline]'),
|
|
|
|
},
|
|
|
|
|
2018-07-24 04:54:23 +00:00
|
|
|
sortOptions: collection('[data-test-sort-by]', {
|
|
|
|
id: attribute('data-test-sort-by'),
|
|
|
|
sort: clickable(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
sortBy(id) {
|
2021-12-28 14:45:20 +00:00
|
|
|
return this.sortOptions.toArray().findBy('id', id).sort();
|
2018-07-24 04:54:23 +00:00
|
|
|
},
|
2018-11-06 00:06:08 +00:00
|
|
|
|
|
|
|
error: error(),
|
2018-07-24 04:54:23 +00:00
|
|
|
});
|