github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/tests/pages/jobs/dispatch.js (about)

     1  import {
     2    clickable,
     3    collection,
     4    create,
     5    fillable,
     6    isPresent,
     7    isVisible,
     8    property,
     9    text,
    10    visitable,
    11  } from 'ember-cli-page-object';
    12  import { codeFillable, code } from 'nomad-ui/tests/pages/helpers/codemirror';
    13  
    14  export default create({
    15    visit: visitable('/jobs/:id/dispatch'),
    16  
    17    dispatchButton: {
    18      scope: '[data-test-dispatch-button]',
    19      isDisabled: property('disabled'),
    20      click: clickable(),
    21      isPresent: isPresent(),
    22    },
    23  
    24    hasError: isVisible('[data-test-dispatch-error]'),
    25  
    26    metaFields: collection('[data-test-meta-field]', {
    27      field: {
    28        scope: '[data-test-meta-field-input]',
    29        input: fillable(),
    30        id: property('id'),
    31      },
    32      label: text('[data-test-meta-field-label]'),
    33    }),
    34  
    35    optionalMetaFields: collection('[data-test-meta-field="optional"]', {
    36      field: {
    37        scope: '[data-test-meta-field-input]',
    38        input: fillable(),
    39        id: property('id'),
    40      },
    41      label: text('[data-test-meta-field-label]'),
    42    }),
    43  
    44    payload: {
    45      title: text('[data-test-payload-head]'),
    46      editor: {
    47        scope: '[data-test-payload-editor]',
    48        isPresent: isPresent(),
    49        contents: code('[data-test-payload-editor]'),
    50        fillIn: codeFillable('[data-test-payload-editor]'),
    51      },
    52      emptyMessage: {
    53        scope: '[data-test-empty-payload-message]',
    54        isPresent: isPresent(),
    55      },
    56    },
    57  });