open-nomad/ui/tests/pages/components/job-client-status-bar.js
2023-04-10 15:36:59 +00:00

42 lines
899 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { attribute, clickable, collection } from 'ember-cli-page-object';
export default (scope) => ({
scope,
slices: collection('svg .bars g', {
label: attribute('data-test-slice-label'),
click: clickable(),
}),
expand: {
scope: '[data-test-accordion-toggle]',
click: clickable(),
},
legend: {
scope: '.legend',
items: collection('li', {
label: attribute('data-test-legend-label'),
}),
clickableItems: collection('li.is-clickable', {
label: attribute('data-test-legend-label'),
click: clickable('a'),
}),
},
visitSlice: async function (label) {
await this.slices.toArray().findBy('label', label).click();
},
visitLegend: async function (label) {
await this.legend.clickableItems.toArray().findBy('label', label).click();
},
});