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

Fix Modal Test using correct Page #28250

Merged
merged 1 commit into from
Mar 8, 2025
Merged

Fix Modal Test using correct Page #28250

merged 1 commit into from
Mar 8, 2025

Conversation

tj-devel709
Copy link
Member

Description of Change

After this PR, the Controls.DeviceTest PushingNavigationPageModallyWithShellShowsToolbarCorrectly is failing because FindResponder is being called on the page that is not currently showing. That page's window is null and the test fails because it cannot continue. The fix is to call FindResponder on the page that is showing instead since that window is not null.

@tj-devel709 tj-devel709 added this to the .NET 9 SR6 milestone Mar 7, 2025
@Copilot Copilot bot review requested due to automatic review settings March 7, 2025 19:04
@tj-devel709 tj-devel709 requested a review from a team as a code owner March 7, 2025 19:04
Copy link
Contributor

@Copilot 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.

PR Overview

This PR fixes a failing modal test by ensuring that the assertions are performed on the correct page that is visible. The changes replace calls that assert properties on windowPage with assertions on a newly created secondPage.

  • Replace anonymous page creation with a named variable for clarity.
  • Update assertions to target the visible page after removing the modal page.

Reviewed Changes

File Description
src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.cs Updated the test to push a second page and perform assertions on its handler rather than on the windowPage handler

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

Comments suppressed due to low confidence (2)

src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.cs:207

  • [nitpick] Using secondPage.Handler instead of windowPage.Handler fixes the issue with null window, but consider adding an inline comment to clarify this reasoning for future maintainers.
await AssertEventually(() => IsNavigationBarVisible(secondPage.Handler));

src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.cs:208

  • [nitpick] Similarly, using secondPage.Handler here is the intended fix; an inline comment explaining the context would improve clarity.
await AssertEventually(() => IsBackButtonVisible(secondPage.Handler));

@PureWeen PureWeen merged commit fa2b417 into main Mar 8, 2025
120 of 128 checks passed
@PureWeen PureWeen deleted the dev/TJ/FixModalTest branch March 8, 2025 22:59
rmarinho pushed a commit that referenced this pull request Mar 11, 2025

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants