Skip to content

feat: ensure selectors are not find in ion-page-hidden pages#17

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

feat: ensure selectors are not find in ion-page-hidden pages#17
distante merged 3 commits intomainfrom
ssd/ignore-ion-page

Conversation

@distante
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 18, 2026 09:04
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

This PR updates the selector helper to avoid returning elements that live under .ion-page-hidden, and adds an example + Cypress coverage to validate that behavior in the demo app.

Changes:

  • Wrap getFromSupportedSelector() results with a .ion-page-hidden exclusion filter.
  • Add demo markup and Cypress tests asserting hidden-page elements are ignored.
  • Update docs generation script to include a custom CNAME and reuse make-docs in the release hook.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/helpers/get-from-supported-selector.ts Filters out matches under .ion-page-hidden for all supported selector input types.
html/index.html Adds a hidden-page example element to validate selector filtering.
cypress/e2e/get-from-supported-selector.spec.ts Adds regression tests for hidden-page filtering behavior.
package.json Updates TypeDoc invocation and release hook to generate docs via make-docs.

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

Comment thread cypress/e2e/get-from-supported-selector.spec.ts
Comment thread src/helpers/get-from-supported-selector.ts
Comment thread src/helpers/get-from-supported-selector.ts Outdated
@distante distante requested a review from Copilot April 18, 2026 09:28
@distante distante merged commit a7425cd into main Apr 18, 2026
8 checks passed
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 6 out of 7 changed files in this pull request and generated 1 comment.


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

Comment on lines 12 to +24
if (isJQuery<T>(selector)) {
// selector.attr('cypress-ionic-test-id', )
return cy.wrap(selector).should('have.class', 'hydrated');
return filterOutHiddenPage(
cy
.wrap(selector)
.should('have.class', 'hydrated') as CypressIonicReturn<T>,
);
}

return (selector as unknown as CypressIonicReturn<T>).should(
'have.class',
'hydrated',
return filterOutHiddenPage(
(selector as unknown as CypressIonicReturn<T>).should(
'have.class',
'hydrated',
),
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

In the Chainable/JQuery branches, the .should('have.class', 'hydrated') assertion runs before filtering out .ion-page-hidden matches. This means hidden-page elements can still cause the command to fail (e.g., if a hidden match is not hydrated yet), even though the intent is to ignore them. Consider filtering out hidden-page elements first, and then only asserting hydration on the remaining elements (and skipping the hydration assertion when the filtered set is empty so callers can assert have.length, 0).

Copilot uses AI. Check for mistakes.
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