github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/tests/pages/components/topo-viz/node.js (about)

     1  import {
     2    attribute,
     3    collection,
     4    clickable,
     5    hasClass,
     6    isPresent,
     7    text,
     8    triggerable,
     9  } from 'ember-cli-page-object';
    10  
    11  const allocationRect = {
    12    select: clickable(),
    13    hover: triggerable('mouseenter'),
    14    mouseleave: triggerable('mouseleave'),
    15    width: attribute('width', '> rect'),
    16    height: attribute('height', '> rect'),
    17    isActive: hasClass('is-active'),
    18    isSelected: hasClass('is-selected'),
    19    running: hasClass('running'),
    20    failed: hasClass('failed'),
    21    pending: hasClass('pending'),
    22  };
    23  
    24  export default (scope) => ({
    25    scope,
    26  
    27    label: text('[data-test-label]'),
    28    labelIsPresent: isPresent('[data-test-label]'),
    29    statusIcon: attribute('class', '[data-test-status-icon] .icon'),
    30    statusIconLabel: attribute('aria-label', '[data-test-status-icon]'),
    31  
    32    selectNode: clickable('[data-test-node-background]'),
    33    nodeIsInteractive: hasClass('is-interactive', '[data-test-node-background]'),
    34    nodeIsSelected: hasClass('is-selected', '[data-test-node-background]'),
    35  
    36    memoryRects: collection('[data-test-memory-rect]', {
    37      ...allocationRect,
    38      id: attribute('data-test-memory-rect'),
    39    }),
    40    cpuRects: collection('[data-test-cpu-rect]', {
    41      ...allocationRect,
    42      id: attribute('data-test-cpu-rect'),
    43    }),
    44  
    45    mouseout: triggerable('mouseout', '[data-test-topo-node-svg]'),
    46  
    47    emptyMessage: text('[data-test-empty-message]'),
    48    isEmpty: hasClass('is-empty'),
    49  });