You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/tests/steps/interactions/click.js

21 lines
606 B

export default function(scenario, find, click) {
scenario
.when('I click "$selector"', function(selector) {
return click(selector);
})
// TODO: Probably nicer to think of better vocab than having the 'without " rule'
.when(
[
'I click (?!")$property(?!")',
'I click $property on the $component',
'I click $property on the $component component',
],
function(property, component, next) {
if (typeof component === 'string') {
property = `${component}.${property}`;
}
return find(property)();
}
);
}