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

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import {
     7    attribute,
     8    collection,
     9    clickable,
    10    create,
    11    hasClass,
    12    isPresent,
    13    text,
    14    visitable,
    15  } from 'ember-cli-page-object';
    16  
    17  export default create({
    18    visitAllocation: visitable('/allocations/:id/fs'),
    19    visitAllocationPath: visitable('/allocations/:id/fs/:path'),
    20  
    21    visitTask: visitable('/allocations/:id/:name/fs'),
    22    visitTaskPath: visitable('/allocations/:id/:name/fs/:path'),
    23  
    24    fileViewer: {
    25      scope: '[data-test-file-viewer]',
    26    },
    27  
    28    breadcrumbsText: text('[data-test-fs-breadcrumbs]'),
    29  
    30    breadcrumbs: collection('[data-test-fs-breadcrumbs] li', {
    31      visit: clickable('a'),
    32      path: attribute('href', 'a'),
    33      isActive: hasClass('is-active'),
    34    }),
    35  
    36    sortOptions: collection('[data-test-sort-by]', {
    37      id: attribute('data-test-sort-by'),
    38      sort: clickable(),
    39    }),
    40  
    41    sortBy(id) {
    42      return this.sortOptions.toArray().findBy('id', id).sort();
    43    },
    44  
    45    directoryEntries: collection('[data-test-entry]', {
    46      name: text('[data-test-name]'),
    47  
    48      isFile: isPresent('.icon-is-file-outline'),
    49      isDirectory: isPresent('.icon-is-folder-outline'),
    50  
    51      size: text('[data-test-size]'),
    52      lastModified: text('[data-test-last-modified]'),
    53  
    54      visit: clickable('a'),
    55      path: attribute('href', 'a'),
    56    }),
    57  
    58    isEmptyDirectory: isPresent('[data-test-empty-directory]'),
    59  
    60    directoryEntryNames() {
    61      return this.directoryEntries.toArray().mapBy('name');
    62    },
    63  
    64    hasEmptyState: isPresent('[data-test-not-running]'),
    65    emptyState: {
    66      headline: text('[data-test-not-running-headline]'),
    67    },
    68  
    69    error: {
    70      title: text('[data-test-error-title]'),
    71    },
    72  });