Skip to content

Add a function to expect that _no_ element matches the given query - #30

Open
hovinen wants to merge 1 commit into
fix-description-for-attribute-matcherfrom
add-expect-no-matching-element
Open

hovinen wants to merge 1 commit into
fix-description-for-attribute-matcherfrom
add-expect-no-matching-element

Conversation

@hovinen

@hovinen hovinen commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Previously, it was a little awkward to assert that a given element was not in the DOM. One could do so with query_all(is_empty()), but this is not so discoverable.

This adds a method expect_no_matching_element to ElementCondition which directly expresses that no such element should exist. It was necessary to make this its own expectation method rather than using a matcher, since matchers are only triggered once an element is found.

@hovinen
hovinen added this pull request to stack #28 September 25, 2026 14:20
@ealmloff
ealmloff force-pushed the add-expect-no-matching-element branch from 783fdae to 33702c9 Compare September 26, 2026 04:19
@hovinen hovinen self-assigned this Oct 3, 2026
@hovinen
hovinen requested a review from ealmloff October 3, 2026 11:47
@hovinen
hovinen force-pushed the add-expect-no-matching-element branch from 33702c9 to af07012 Compare October 16, 2026 19:03
Previously, it was a little awkward to assert that a given element was
_not_ in the DOM. One could do so with `query_all(is_empty())`, but this
is not so discoverable.

This adds a method `expect_no_matching_element` to `ElementCondition`
which directly expresses that no such element should exist. It was
necessary to make this its own expectation method rather than using a
matcher, since matchers are only triggered once an element is found.
@hovinen
hovinen force-pushed the add-expect-no-matching-element branch from af07012 to c250a48 Compare October 23, 2026 07:06
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.

2 participants