thefrontside / thefrontside/interactors

Consider adding `element` filter to base `HTML` interactor

Open
#24 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
TypeScript
Stars
36
Forks
2
Avg merge
4m
Merged PRs (30d)
2

Description

Unlike business app authors, component library authors often need to make assertions on the actual layout a component and how it renders. One way to deal with this is to add custom filters, like clientTop if you need to make an assertion on what the coordinates of the top, you can add a filter.

await component.has(clientTop: 10);

But a filter that nobody should ever use except in the context of the component library itself is of dubious value.

One option is to make element a filter, that way, you can implement custom matchers on it to your heart's content. So instead of having a clientTop filter, you can just have a matcher:

await component.has(element: withClientTop(10));

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the base HTML interactor and review how filters and custom matchers are represented. Compare the proposed element filter with the clientTop example, then define what behavior and tests would demonstrate that component authors can apply custom matchers to the underlying element.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.