thefrontside / thefrontside/interactors

Should Checkbox `checked` filter also exclude any indeterminate checkboxes

Open
#19 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Checkbox has two different flags checked and indeterminate both can be in two states

  • checked=false and indeterminate=false
    image

  • checked=true and indeterminate=false
    image

  • checked=false and indeterminate=true
    image

  • checked=true and indeterminate=true
    image

As you can see the indeterminate has higher priority for UI view. And it doesn't matter if a checkbox has checked or not when indeterminate is true. User sees only a checkbox in an indeterminate state.

For now, Checkbox interactor doesn't check the indeterminate state for the checked filter. And if user has the checkbox in forth case the Checkbox({ checked: true }).exists() doesn't throw an exception. But for a real user, who works in a browser, the view will be different, he sees only a checkbox in an indeterminate state.

Should we change Checkbox interactor's checked filter API?

There are possible variants:

  • 👀
    checked: (element) => element.checked && !element.indeterminate
  • 👍
    checked: (element) => element.indeterminate ? 'indeterminate' : element.checked

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 Checkbox interactor's checked filter and inspect how it represents the checked and indeterminate states. Compare the two API variants described in the issue, then identify the existing Checkbox interactor tests or entry points that would need to define the intended behavior. Done means the API decision is implemented and the fourth state no longer matches checked if that is the chosen behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.