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

Simplify tests by extracting boilerplate #27072

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Conversation

mattleibow
Copy link
Member

Description of Change

I am planning on adding a bunch more tests and the duplicate code is making me sad. This PR does not change code and just refactors the tests a bit.

@Copilot Copilot bot review requested due to automatic review settings January 10, 2025 19:40
@mattleibow mattleibow requested a review from a team as a code owner January 10, 2025 19:40
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.

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

Files not reviewed (1)
  • src/Controls/tests/DeviceTests/Resources/Raw/HybridTestRoot/invokedotnettests.html: Language not supported
Comments suppressed due to low confidence (1)

src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests.cs:321

  • [nitpick] The method name 'RunTest' is generic. Consider renaming it to something more descriptive like 'ExecuteHybridWebViewTest'.
Task RunTest(Func<HybridWebView, Task> test) =>

@@ -523,5 +317,45 @@ await Retry(async () =>
}, createExceptionWithTimeoutMS: (int timeoutInMS) => Task.FromResult(new Exception($"Waited {timeoutInMS}ms but couldn't get status element to have a non-empty value.")));
}
}

Task RunTest(Func<HybridWebView, Task> test) =>
Copy link
Preview

Copilot AI Jan 10, 2025

Choose a reason for hiding this comment

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

Ensure that the refactored code, especially the new 'RunTest' method, is covered by tests in TestCases.Shared.Tests and can execute properly on TestCases.HostApp.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@jfversluis jfversluis merged commit 844b6c7 into main Jan 11, 2025
104 checks passed
@jfversluis jfversluis deleted the dev/hybridwebview-tests branch January 11, 2025 09:28
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants