Skip to content

feat(dom): toBePressed and toBePartiallyPressed#172

Open
KeylaMunnoz wants to merge 9 commits into
mainfrom
feat-dom-to-be-pressed
Open

feat(dom): toBePressed and toBePartiallyPressed#172
KeylaMunnoz wants to merge 9 commits into
mainfrom
feat-dom-to-be-pressed

Conversation

@KeylaMunnoz
Copy link
Copy Markdown
Collaborator

What has been added:

  • toBePressed and toBePartiallyPressed assertions
  • isButtonElement and isValidAriaPressed helpers
  • tests for these assertions

@KeylaMunnoz KeylaMunnoz requested review from JDOM10 and SbsCruz May 18, 2026 19:37
Comment thread packages/dom/src/lib/helpers/dom.ts
Copy link
Copy Markdown
Collaborator

@JDOM10 JDOM10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @KeylaMunnoz! Thank you for working on this, this is looking great! Just left a small comment :shipit:

Anything else you would like to add? @suany0805

@JDOM10 JDOM10 requested a review from suany0805 May 18, 2026 20:48
Comment thread packages/dom/src/lib/helpers/accessibility.ts Outdated
Comment thread packages/dom/src/lib/helpers/dom.ts Outdated
Copy link
Copy Markdown
Contributor

@suany0805 suany0805 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work! just left a couple of comments

Comment thread packages/dom/src/lib/ElementAssertion.ts Outdated
Comment thread packages/dom/src/lib/ElementAssertion.ts Outdated
Comment thread packages/dom/src/lib/ElementAssertion.ts
Comment thread packages/dom/src/lib/ElementAssertion.ts
Comment thread packages/dom/src/lib/ElementAssertion.ts Outdated
);
}

const pressedAttribute = this.actual.getAttribute("aria-pressed");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to pressedAttributeValue, since I get you could receive: true, false or mixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what does mixed specifically involve ? (for context and understanding)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Su sure ! mixed represents a partially pressed state so it's typically used when a toggle button controls multiple items and only some of them are in the pressed state.
In these cases, the button cannot be accurately described as either fully pressed (true) or not pressed (false), so mixed indicates that the controlled state is not consistent across the affected items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants