github.com/hernad/nomad@v1.6.112/ui/tests/pages/clients/list.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import {
     7    attribute,
     8    create,
     9    collection,
    10    clickable,
    11    fillable,
    12    hasClass,
    13    isHidden,
    14    isPresent,
    15    text,
    16    visitable,
    17  } from 'ember-cli-page-object';
    18  
    19  import { multiFacet } from 'nomad-ui/tests/pages/components/facet';
    20  import pageSizeSelect from 'nomad-ui/tests/pages/components/page-size-select';
    21  
    22  export default create({
    23    pageSize: 25,
    24  
    25    visit: visitable('/clients'),
    26  
    27    search: fillable('.search-box input'),
    28  
    29    sortOptions: collection('[data-test-sort-by]', {
    30      id: attribute('data-test-sort-by'),
    31      sort: clickable(),
    32    }),
    33  
    34    sortBy(id) {
    35      return this.sortOptions.toArray().findBy('id', id).sort();
    36    },
    37  
    38    nodes: collection('[data-test-client-node-row]', {
    39      id: text('[data-test-client-id]'),
    40      name: text('[data-test-client-name]'),
    41  
    42      compositeStatus: {
    43        scope: '[data-test-client-composite-status]',
    44  
    45        tooltip: attribute('aria-label', '.tooltip'),
    46  
    47        isInfo: hasClass('is-info', '.status-text'),
    48        isWarning: hasClass('is-warning', '.status-text'),
    49        isUnformatted: isHidden('.status-text'),
    50      },
    51  
    52      address: text('[data-test-client-address]'),
    53      nodePool: text('[data-test-client-node-pool]'),
    54      datacenter: text('[data-test-client-datacenter]'),
    55      version: text('[data-test-client-version]'),
    56      allocations: text('[data-test-client-allocations]'),
    57  
    58      clickRow: clickable(),
    59      clickName: clickable('[data-test-client-name] a'),
    60    }),
    61  
    62    hasPagination: isPresent('[data-test-pagination]'),
    63  
    64    isEmpty: isPresent('[data-test-empty-clients-list]'),
    65    empty: {
    66      headline: text('[data-test-empty-clients-list-headline]'),
    67    },
    68  
    69    pageSizeSelect: pageSizeSelect(),
    70  
    71    error: {
    72      isPresent: isPresent('[data-test-error]'),
    73      title: text('[data-test-error-title]'),
    74      message: text('[data-test-error-message]'),
    75      seekHelp: clickable('[data-test-error-message] a'),
    76    },
    77  
    78    facets: {
    79      nodePools: multiFacet('[data-test-node-pool-facet]'),
    80      class: multiFacet('[data-test-class-facet]'),
    81      state: multiFacet('[data-test-state-facet]'),
    82      datacenter: multiFacet('[data-test-datacenter-facet]'),
    83      version: multiFacet('[data-test-version-facet]'),
    84      volume: multiFacet('[data-test-volume-facet]'),
    85    },
    86  });