open-consul/ui-v2/app/components/policy-selector/pageobject.js

21 lines
510 B
JavaScript
Raw Normal View History

export default (clickable, deletable, collection, alias, policyForm) => (
scope = '#policies',
createSelector = '[for="new-policy-toggle"]'
) => {
return {
scope: scope,
create: clickable(createSelector),
form: policyForm('#new-policy-toggle + div'),
policies: alias('selectedOptions'),
selectedOptions: collection(
'[data-test-policies] [data-test-tabular-row]',
deletable(
{
expand: clickable('label'),
},
'+ tr'
)
),
};
};