Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(many): replace ionic buttons in e2e tests with native html buttons #29422

Merged
merged 17 commits into from May 2, 2024

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Apr 29, 2024

Issue number: internal


What is the current behavior?

The ion-button component is used in several tests to navigate or show overlays. This causes screenshot diffs in unrelated tests any time the UI of the ion-button is updated.

What is the new behavior?

Removes the ion-button elements from unrelated tests.

Did not remove the ion-buttons from the following tests:

  • All ion-buttons in an ion-buttons component
  • An ion-button inside of a menu
  • breadcrumbs/test/basic (uses a clear button in a list header, needs to be moved)
  • input/test/slot
  • item/test/buttons
  • item/test/colors
  • item/test/dividers
  • item/test/inputs
  • item/test/media
  • list-header/test/basic
  • ripple-effect/test/basic
  • router/test/basic
  • router/test/guards
  • router-outlet/test/basic
  • select/test/slot
  • textarea/test/slot

Updates the icon/basic test to use the right icon names by comparing against the v3 names: https://ionicframework.com/docs/v3/ionicons/

Does this introduce a breaking change?

  • Yes
  • No

Copy link

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2024 6:55pm

@github-actions github-actions bot added the package: core @ionic/core package label Apr 29, 2024
@@ -143,7 +152,7 @@ <h3>mode: md</h3>
dynamicHomeIcon.name = 'home';
dynamicHomeIcon.isActive = false;

icons = ['home', 'star', 'ios-alert', 'ios-alert-outline', 'md-alert', 'logo-apple'];
icons = ['home', 'star', 'alert-circle', 'alert-circle-outline', 'alert-circle-sharp', 'logo-apple'];
Copy link
Member Author

Choose a reason for hiding this comment

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

I updated this to use the latest Ionicon names by comparing the older names with the v3 Ionicons to see what it should be now: https://ionicframework.com/docs/v3/ionicons


button {
display: block;
width: 100%;
Copy link
Member Author

Choose a reason for hiding this comment

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

I chose to default to 100% width here because it seemed the more common use case, but I could be convinced to make an inline, auto-width button the default if we prefer that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Spoke with the team during office hours. We decided to update the button to be inline-block by default and then add a class called expand which replaces the old expand="block" behavior that using an ion-button had.

Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

One question that applies to a few places around the color attribute on the button element.

core/src/components/content/test/basic/index.html Outdated Show resolved Hide resolved
core/src/components/searchbar/test/basic/index.html Outdated Show resolved Hide resolved
core/src/components/segment/test/basic/index.html Outdated Show resolved Hide resolved
core/src/components/tabs/test/basic/index.html Outdated Show resolved Hide resolved
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

Great work!

@sean-perkins sean-perkins removed the request for review from liamdebeasi May 2, 2024 18:13
@brandyscarney brandyscarney changed the title test(many): update to remove ionic buttons from e2e tests test(many): replace ionic buttons in e2e tests with native html buttons May 2, 2024
@brandyscarney brandyscarney added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit 0124f3b May 2, 2024
48 checks passed
@brandyscarney brandyscarney deleted the bc/remove-button-tests-main branch May 2, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants