Skip to content

Add behavior tests for BitSelectField#82

Merged
albx merged 3 commits intofeature/38-select-componentfrom
copilot/sub-pr-78
Feb 12, 2026
Merged

Add behavior tests for BitSelectField#82
albx merged 3 commits intofeature/38-select-componentfrom
copilot/sub-pr-78

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Adds behavior tests to verify value binding and type conversion for the BitSelectField component, addressing missing test coverage for the component's core functionality.

Tests Added

Created BitSelectFieldTest.Behaviors.cs with 8 test methods covering:

  • Type conversion: String, int, and enum value changes
  • Nullable types: Nullable int and enum handling
  • Two-way binding: Bound value updates on selection changes
  • DOM state: Selected attribute setting and updates
[Fact]
public void BitSelectField_Should_Change_Enum_Value_Correctly()
{
    TestEnum value = TestEnum.Option1;
    
    var component = ctx.Render<BitSelectField<TestEnum>>(parameters => parameters
        .Bind(p => p.Value, value, v => value = v)
        .AddChildContent<BitSelectItem<TestEnum>>(/* ... */));
    
    var select = component.Find("select");
    select.Change(TestEnum.Option3);
    
    Assert.Equal(TestEnum.Option3, value);
}

All tests pass with no warnings or security alerts.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 11, 2026 08:31
Co-authored-by: albx <5121303+albx@users.noreply.github.com>
…move unnecessary null-forgiving operators

Co-authored-by: albx <5121303+albx@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on 'Add select component' PR Add behavior tests for BitSelectField Feb 11, 2026
Copilot AI requested a review from albx February 11, 2026 08:34
@albx albx marked this pull request as ready for review February 12, 2026 16:07
@albx albx merged commit 280e2c7 into feature/38-select-component Feb 12, 2026
1 check passed
@albx albx deleted the copilot/sub-pr-78 branch February 12, 2026 16:08
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