feat: add IonTabButtonCypress helper for ion-tab-button#19
Merged
Conversation
Exposes a click() method that pierces the shadow DOM to interact with the inner <a class="button-native"> element, following the same pattern as existing component helpers.
There was a problem hiding this comment.
Pull request overview
Adds first-class Cypress support for interacting with Ionic ion-tab-button by introducing a dedicated helper, a fixture page to validate behavior, and an accompanying Cypress spec.
Changes:
- Added
IonTabButtonCypresshelper with aclick()that targets the inner native element inside the component’s shadow DOM. - Exported the helper via the components barrel exports.
- Added an HTML fixture page + script and a Cypress spec to validate clicking via CSS selector and jQuery element.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/components/tab-button.ts | New IonTabButtonCypress helper that clicks the inner native element. |
| src/components/index.ts | Re-exports the new tab-button helper from the components barrel. |
| html/ion-tab-button.html | New fixture page with multiple tab buttons and a click status indicator. |
| html/index.html | Adds navigation link to the new fixture page. |
| html/assets/ion-tab-button.mjs | Fixture script that updates status on ionTabButtonClick. |
| cypress/e2e/components/tab-button.spec.ts | New Cypress coverage for tab-button clicking scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IonTabButtonCypressclass with aclick()method that pierces the shadow DOM to interact with the inner<a class="button-native">elementionTabButtonCypresssingleton via the existing barrel exportshtml/ion-tab-button.html) with three tab buttons and a status indicator for asserting click events