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';
|
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(),
|
|
|
|
|
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) {
|
|
|
|
return this.sortOptions
|
|
|
|
.toArray()
|
|
|
|
.findBy('id', id)
|
|
|
|
.sort();
|
|
|
|
},
|
2018-11-06 00:06:08 +00:00
|
|
|
|
|
|
|
error: error(),
|
2018-07-24 04:54:23 +00:00
|
|
|
});
|