2021-10-07 21:11:38 +00:00
|
|
|
import { attribute, clickable, collection } from 'ember-cli-page-object';
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
export default (scope) => ({
|
2021-10-07 21:11:38 +00:00
|
|
|
scope,
|
|
|
|
|
|
|
|
slices: collection('svg .bars g', {
|
|
|
|
label: attribute('data-test-slice-label'),
|
|
|
|
click: clickable(),
|
|
|
|
}),
|
|
|
|
|
2022-01-26 16:30:06 +00:00
|
|
|
expand: {
|
|
|
|
scope: '[data-test-accordion-toggle]',
|
|
|
|
click: clickable(),
|
|
|
|
},
|
|
|
|
|
2021-10-07 21:11:38 +00:00
|
|
|
legend: {
|
|
|
|
scope: '.legend',
|
|
|
|
|
|
|
|
items: collection('li', {
|
2022-01-12 16:18:01 +00:00
|
|
|
label: attribute('data-test-legend-label'),
|
2021-10-07 21:11:38 +00:00
|
|
|
}),
|
|
|
|
|
|
|
|
clickableItems: collection('li.is-clickable', {
|
2022-01-12 16:18:01 +00:00
|
|
|
label: attribute('data-test-legend-label'),
|
2021-10-07 21:11:38 +00:00
|
|
|
click: clickable('a'),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
visitSlice: async function (label) {
|
|
|
|
await this.slices.toArray().findBy('label', label).click();
|
2021-10-07 21:11:38 +00:00
|
|
|
},
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
visitLegend: async function (label) {
|
|
|
|
await this.legend.clickableItems.toArray().findBy('label', label).click();
|
2021-10-07 21:11:38 +00:00
|
|
|
},
|
|
|
|
});
|