Skip to content

fix: filter ion-page-hidden elements before asserting hydration in JQ…#18

Merged
distante merged 2 commits intomainfrom
ssd/ignore-ion-page
Apr 18, 2026
Merged

fix: filter ion-page-hidden elements before asserting hydration in JQ…#18
distante merged 2 commits intomainfrom
ssd/ignore-ion-page

Conversation

@distante
Copy link
Copy Markdown
Owner

…uery/Chainable branches

In the JQuery and Chainable branches, the hydration assertion ran on the full element set before hidden-page elements were filtered out. If all elements were on hidden pages and lacked the .hydrated class, Cypress's .not() command would retry until timeout rather than returning an empty set.

The fix uses jQuery's native .not() synchronously inside a .then() callback to filter hidden elements first, then skips the hydration assertion when the filtered set is empty.

…uery/Chainable branches

In the JQuery and Chainable branches, the hydration assertion ran on the full
element set before hidden-page elements were filtered out. If all elements were
on hidden pages and lacked the .hydrated class, Cypress's .not() command would
retry until timeout rather than returning an empty set.

The fix uses jQuery's native .not() synchronously inside a .then() callback to
filter hidden elements first, then skips the hydration assertion when the
filtered set is empty.
Copilot AI review requested due to automatic review settings April 18, 2026 09:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Cypress timeout edge case by ensuring elements inside hidden Ionic pages are filtered out before asserting .hydrated for jQuery and Chainable selector inputs.

Changes:

  • Replace the jQuery/Chainable hydration-then-filter flow with a filter-then-hydration assertion (filterThenAssertHydrated()).
  • Skip hydration assertions when the post-filter set is empty to avoid Cypress retry timeouts.
  • Add Cypress E2E coverage for the hidden-page filtering order regression.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/helpers/get-from-supported-selector.ts Introduces filterThenAssertHydrated() and switches jQuery/Chainable branches to filter hidden-page elements before hydration assertions.
cypress/e2e/get-from-supported-selector.spec.ts Adds regression tests ensuring hidden, non-hydrated matches don’t cause timeouts and that visible matches are returned correctly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/helpers/get-from-supported-selector.ts
Comment thread src/helpers/get-from-supported-selector.ts Outdated
Route the string-selector path through the same filter-then-assert flow as Chainable/JQuery inputs,
so hidden page matches are removed before checking hydrated class.
Prevents timeout retries when all matches are inside ion-page-hidden and never hydrated,
returning an empty set instead.

Add a Cypress regression test for the css-selector hidden-only non-hydrated scenario.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/helpers/get-from-supported-selector.ts
Comment thread src/helpers/get-from-supported-selector.ts
@distante distante merged commit c4c7b7a into main Apr 18, 2026
8 checks passed
@distante distante deleted the ssd/ignore-ion-page branch April 18, 2026 10:28
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