Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Collection selector function de-scopes the collection #17

Open
wwilsman opened this issue Oct 12, 2018 · 0 comments
Open

Collection selector function de-scopes the collection #17

wwilsman opened this issue Oct 12, 2018 · 0 comments
Labels

Comments

@wwilsman
Copy link
Contributor

An undocumented feature of the collection helper is its ability to generate a selector given a function. This is actually a feature of all interactors, and collection is able to utilize it since it returns a function whose arguments can be curried to the selector function.

radios = collection(value => `[type="radio"][value="${value}"]`);
interactor.radios('red') //=> scoped interactor for the red radio button.

However, new top-level Interactor instances are globally scoped which means that when collection encounters a function and passes it along to the constructor, that collection item becomes globally scoped.

Collections are meant to remain scoped, so we need to make it so passing a selector function retains that scope. After this work I think we can finally document this feature.

@taras taras transferred this issue from bigtestjs/interactor Dec 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant