test: bUnit update from 1.40.0 → 2.8.6 (latest stable) - #273
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
damyanpetev
force-pushed
the
dpetev/bunit-update
branch
from
July 28, 2026 17:30
8d40ac0 to
28663e6
Compare
damyanpetev
marked this pull request as ready for review
July 28, 2026 17:30
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the test infrastructure in tests/IgniteUI.Blazor.Tests to bUnit v2, aligning the suite with the latest stable bUnit APIs and removing the vulnerable dependency warning tied to the older bUnit version.
Changes:
- Bump
bunitpackage version from1.40.0to2.8.6. - Migrate tests to bUnit v2 idioms (
TestContext→BunitContext,RenderComponent<T>→Render<T>). - Rework the contract-hosting test helper to avoid bUnit v2 internal APIs by deferring host rendering to the active test context and updating related interop harness types.
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/IgniteUI.Blazor.Tests/AlertTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/AvatarTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/BadgeExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/BadgeTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/BaseControlTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/BlazorComponentTestBase.cs | Switches base test context from TestContext to BunitContext. |
| tests/IgniteUI.Blazor.Tests/ButtonGroupTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ButtonTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/CardTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/CarouselTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ChatTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/CheckboxTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ChipTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/CircularGradientTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ComboTests.cs | Updates contract helpers to use IRenderedComponent<IComponent> and bUnit v2 types. |
| tests/IgniteUI.Blazor.Tests/ComponentWithContractTestBase.cs | Adjusts contract runner plumbing for bUnit v2 (host thunk + covariant rendered-component scope). |
| tests/IgniteUI.Blazor.Tests/DateTimeInputTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/DialogExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/DialogTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/DropdownExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/DropdownTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/EnumSerializationTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ExpansionPanelTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/HighlightTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/IconButtonTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/IconTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/InputExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/InputTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/Interop/ComponentContract.cs | Reworks ContractHost to return a context-based render thunk and updates hosted-spec types accordingly. |
| tests/IgniteUI.Blazor.Tests/Interop/InteropHarness.cs | Updates harness APIs to use IRenderedComponent<IComponent> instead of removed IRenderedFragment. |
| tests/IgniteUI.Blazor.Tests/Interop/RendererMessageInteropHarness.cs | Updates harness implementation signatures to match new rendered-component scope types. |
| tests/IgniteUI.Blazor.Tests/InteropEventTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/InteropReadinessTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ListTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/MethodInteropTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/MiscComponentTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/NavDrawerTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/NavigationTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ProgressExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ProgressTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/RadioTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/RatingTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/RenderingSerializationTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SelectExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SelectTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SliderExtendedTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SliderTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SplitterTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/StepperTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/SwitchTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/TabsTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/TextInputTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ThemeProviderTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/TileManagerTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/ToggleButtonTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/TooltipTests.cs | Updates component rendering calls to bUnit v2 Render<T>(). |
| tests/IgniteUI.Blazor.Tests/TreeTests.cs | Updates rendering calls and hosted contract setup to the new context-thunk host model. |
| skills/igniteui-blazor-lite-testing/SKILL.md | Updates docs to reflect BunitContext naming in the test base class description. |
| Directory.Packages.props | Bumps bunit package version to 2.8.6. |
damyanpetev
enabled auto-merge (squash)
July 29, 2026 07:39
MayaKirova
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bUnit is migrated from 1.40.0 → 2.8.6 (latest stable) per https://bunit.dev/docs/migrations/1to2.html, resolving the vulnerable dependency warning in old version.
What changed
Package —
Directory.Packages.props: bunit 1.40.0 → 2.8.6.Mechanical v2 renames (across tests/IgniteUI.Blazor.Tests):
TestContext→BunitContext(base class) —BlazorComponentTestBase.csRenderComponent<T>→Render<T>(~230 call sites)IRenderedFragment→IRenderedComponent<IComponent>— v2 removed the non-generic public interface;IRenderedComponent<out TComponent>is covariant, so<IComponent>is the correct non-generic scope handleNon-mechanical fixes (v2 removed public API the harness relied on):
ComponentWithContractTestBase.cs:where TComponent : IComponent→where TComponent : class, IComponent. The covariant conversionIRenderedComponent<TComponent>→IRenderedComponent<IComponent>only applies when the type arg is a reference type; Blazor components always are.ComponentContract.cs. v2 madeComponentParameterCollectionBuilder.Build()and theComponentParameterCollectiontype internal, closing every public route to a detached hostRenderFragment. Rather than reflect into internals (fragile),ContractHost.Of<THost>now returnsFunc<BunitContext, IRenderedComponent<IComponent>>=ctx => ctx.Render<THost>(arrange), deferring the render to the context. Followed the type through the twoGetterhosted overloads, theHostproperty,treeHostin TreeTests, and thescope = method.Host(this)call site.Doc — SKILL.md:
TestContext→BunitContext.All three TFMs build clean and the full suite is green: 920 passed, 0 failed, 22 skipped on net8.0/net9.0/net10.0 (the 22 skips are pre-existing
[Skip]attribute specs, untouchedOne note: RenderComponent actually still exists in v2 as a compat alias, so that rename wasn't strictly required — but Render is the v2-idiomatic name, so the change is worth keeping.