github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/tests/pages/jobs/job/allocations.js (about)

     1  import {
     2    attribute,
     3    clickable,
     4    create,
     5    collection,
     6    fillable,
     7    isPresent,
     8    text,
     9    visitable,
    10  } from 'ember-cli-page-object';
    11  
    12  import allocations from 'nomad-ui/tests/pages/components/allocations';
    13  import error from 'nomad-ui/tests/pages/components/error';
    14  
    15  export default create({
    16    visit: visitable('/jobs/:id/allocations'),
    17  
    18    pageSize: 25,
    19  
    20    hasSearchBox: isPresent('[data-test-allocations-search]'),
    21    search: fillable('[data-test-allocations-search] input'),
    22  
    23    ...allocations(),
    24  
    25    isEmpty: isPresent('[data-test-empty-allocations-list]'),
    26    emptyState: {
    27      headline: text('[data-test-empty-allocations-list-headline]'),
    28    },
    29  
    30    sortOptions: collection('[data-test-sort-by]', {
    31      id: attribute('data-test-sort-by'),
    32      sort: clickable(),
    33    }),
    34  
    35    sortBy(id) {
    36      return this.sortOptions
    37        .toArray()
    38        .findBy('id', id)
    39        .sort();
    40    },
    41  
    42    error: error(),
    43  });