Skip to content

Add test coverage for Contracts New Page#733

Merged
StuartFerguson merged 3 commits intomainfrom
copilot/improve-code-coverage-contracts-again
Feb 4, 2026
Merged

Add test coverage for Contracts New Page#733
StuartFerguson merged 3 commits intomainfrom
copilot/improve-code-coverage-contracts-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 4, 2026

Contracts New Page had no test coverage. Added 10 tests following Estate Index Page patterns for button navigation and form interactions.

Tests Added

  • Rendering & Navigation: Page render, PageTitle component, Cancel button → /contracts, Create Contract button presence
  • Operator Loading: Success and empty states for operator dropdown
  • Form Submission: Success with navigation, failure with error display
  • Validation: Required field enforcement for Description and Operator

Pattern Example

Following Estate Index approach for button finding and navigation verification:

IRefreshableElementCollection<IElement> buttons = cut.FindAll("button");
IElement? cancelButton = buttons.FirstOrDefault(b => b.TextContent.Contains("Cancel"));
cancelButton.Click();

_fakeNavigationManager.Uri.ShouldContain("/contracts");

Test Count: ContractsNewPageTests.cs: 10 tests (previously 0)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /usr/bin/dotnet dotnet test --filter FullyQualifiedName~ContractsNewPageTests --verbosity normal (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --verbosity quiet (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet restore /home/REDACTED/work/EstateManagementUI/EstateManagementUI/EstateManagementUI.sln ep/bin/linux-x64/rg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve Code Coverage on Contracts New Page</issue_title>
<issue_description>Use the estate index page tests as a guide on how to find buttons and also verify navigation</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Improve code coverage on contracts new page Add test coverage for Contracts New Page Feb 4, 2026
Copilot AI requested a review from StuartFerguson February 4, 2026 13:25
@StuartFerguson StuartFerguson marked this pull request as ready for review February 4, 2026 13:26
@StuartFerguson StuartFerguson merged commit ddd087c into main Feb 4, 2026
10 checks passed
@github-actions github-actions Bot deleted the copilot/improve-code-coverage-contracts-again branch April 6, 2026 01:14
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.

Improve Code Coverage on Contracts New Page

2 participants