Skip to content

Improved InputCheckBox Test Coverage in Blazor#67016

Open
PreethikaSelvam wants to merge 3 commits into
dotnet:mainfrom
PreethikaSelvam:CheckBoxTestingImprove
Open

Improved InputCheckBox Test Coverage in Blazor#67016
PreethikaSelvam wants to merge 3 commits into
dotnet:mainfrom
PreethikaSelvam:CheckBoxTestingImprove

Conversation

@PreethikaSelvam
Copy link
Copy Markdown

@PreethikaSelvam PreethikaSelvam commented Jun 4, 2026

Description

This PR significantly enhances the test coverage of the Blazor InputCheckbox component by adding 20 new test cases, increasing the total test count to 23 with 100% pass rate.
image

Key Improvements:

  • Expanded coverage across all critical areas:
  • Rendering (type, id, name, value)
  • Checked/unchecked state behavior
  • Two-way binding and event handling (onchange)
  • ValueChanged callback validation
  • CSS class updates (valid, invalid, modified states)
  • EditContext integration and field change tracking
  • Attribute propagation and override scenarios
  • Edge cases (no EditContext, unchanged values)

Testing Enhancements

  • Added strict assertions to ensure regressions are caught
  • Verified event binding via handler ID checks
  • Ensured EditContext notifications and validation states are correctly triggered
  • Improved robustness by replacing risky assertions with safer patterns

Impact

  • Eliminates previous coverage gaps (binding, validation, CSS, events)
  • Strengthens regression protection for checkbox behavior
  • Aligns with unit testing best practices for component-level validation

PR Checklist

  • Small and focused — Only test improvements for InputCheckbox
  • Tests added — 20 new test cases added
  • Code style matches — Follows existing patterns
  • Local build passes
  • Local tests pass (23/23)
  • No breaking changes
  • Issue linked (if applicable) — Not applicable
  • Public API updates — Not applicable
  • XML documentation — Not applicable

@PreethikaSelvam PreethikaSelvam requested a review from a team as a code owner June 4, 2026 10:12
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Jun 4, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 4, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Thanks for your PR, @PreethikaSelvam. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@PreethikaSelvam PreethikaSelvam force-pushed the CheckBoxTestingImprove branch from 3b235bf to 0233123 Compare June 5, 2026 05:59
@PreethikaSelvam
Copy link
Copy Markdown
Author

@dotnet-policy-service agree company="Syncfusion, Inc."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant