thefrontside / thefrontside/interactors
Ability to specify a Negative Context
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36
- Forks
- 2
- Avg merge
- 4m
- Merged PRs (30d)
- 2
Description
I ran into a situation when using interactors on a project where there were two instances of a component on screen. One that was inside a TabPane, and one that was not. Let's call the component C
The containment hierarchy was:
- Parent
- C()
- Tabs()
- C()
It is possible in this scenario to To interact with C(2) unambiguously, via:
Tabs().find(C())
But it is NOT possible to interact with C(1) unambiguously because there is no context you can specify in which C(2) is not also in that context.
There are a couple of workarounds:
- Create a filter on the DOM order, and use it to disambiguate
- Create
standalonefilter onC()to see if it was in a tab pane, or not.
But these are not ideal because neither of these filters are stable over time.
Ideally, we'd like to have a "negative context" specifier to say that I want to interact with C not within the context of Tabs:
C().outside(Tabs()).click()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test entry point is named in the issue. Start by locating the interactor context and filter implementation and its tests; done means an API can select C outside Tabs while preserving existing positive-context behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100