Skip to content

Add file upload model binding integration tests#444

Merged
gunndabad merged 2 commits intomodelbindingtestsfrom
copilot/sub-pr-439
Feb 1, 2026
Merged

Add file upload model binding integration tests#444
gunndabad merged 2 commits intomodelbindingtestsfrom
copilot/sub-pr-439

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Adds integration tests for file upload tag helper model binding, completing the test coverage pattern established for other input types (text input, password input, date input, textarea, character count).

Changes

  • Test methods: FileUpload_RendersCorrectly and FileUploadOverridden_RendersCorrectly verify model binding behavior for name, id, label, hint, and error message attributes
  • Model: FileUploadTestsModel with IFormFile property and display metadata
  • Controller actions: FileUpload() and FileUploadOverridden() that populate model state errors
  • Views: FileUpload.cshtml and FileUploadOverridden.cshtml demonstrating basic and overridden tag helper usage
<govuk-file-upload for="File" />

<govuk-file-upload for="File" name="OverriddenName" id="OverriddenId">
    <govuk-file-upload-label>Overridden label</govuk-file-upload-label>
    <govuk-file-upload-hint>Overridden hint</govuk-file-upload-hint>
    <govuk-file-upload-error-message>Overridden error message</govuk-file-upload-error-message>
</govuk-file-upload>

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tag helper model binding integration tests Add file upload model binding integration tests Feb 1, 2026
Copilot AI requested a review from gunndabad February 1, 2026 14:59
@gunndabad gunndabad marked this pull request as ready for review February 1, 2026 15:01
@gunndabad gunndabad merged commit 923ed6f into modelbindingtests Feb 1, 2026
4 checks passed
@gunndabad gunndabad deleted the copilot/sub-pr-439 branch February 1, 2026 15:01
gunndabad added a commit that referenced this pull request Feb 7, 2026
* Add tag helper model binding integration tests for text input

* Add password input tests to TagHelperModelBindingTests (#440)

* Initial plan

* Add password input tests to TagHelperModelBindingTests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Remove PauseAsync debug statement

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add date input tests to TagHelperModelBindingTests (#441)

* Initial plan

* Add date input tests to TagHelperModelBindingTests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add separate test for overriden item names and IDs

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
Co-authored-by: James Gunn <james@gunn.io>

* Add textarea model binding integration tests (#442)

* Initial plan

* Add textarea tests to TagHelperModelBindingTests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add character count model binding integration tests (#443)

* Initial plan

* Add character count model binding integration tests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add file upload model binding integration tests (#444)

* Initial plan

* Add file upload model binding integration tests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add select tag helper model binding integration tests (#445)

* Initial plan

* Add select model binding integration tests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add checkbox model binding integration tests (#446)

* Initial plan

* Add checkbox model binding integration test

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

* Add test for overridden attributes

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
Co-authored-by: James Gunn <james@gunn.io>

* Add radios model binding integration tests (#447)

* Initial plan

* Add radios model binding integration tests

Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
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.

2 participants