Skip to content

Add test coverage for prerendering closed generic components#5

Open
tomerqodo wants to merge 2 commits into
cursor_full_base_add_test_coverage_for_prerendering_closed_generic_components_pr5from
cursor_full_head_add_test_coverage_for_prerendering_closed_generic_components_pr5
Open

Add test coverage for prerendering closed generic components#5
tomerqodo wants to merge 2 commits into
cursor_full_base_add_test_coverage_for_prerendering_closed_generic_components_pr5from
cursor_full_head_add_test_coverage_for_prerendering_closed_generic_components_pr5

Conversation

@tomerqodo

@tomerqodo tomerqodo commented Jan 25, 2026

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#5


Note

Expands test coverage to validate closed generic component support across render modes and descriptor deserialization.

  • Adds GenericComponent.razor test component (@typeparam TValue, parameter Value) used to verify output
  • New tests in EndpointHtmlRendererTest.cs for rendering and prerendering GenericComponent<T> in static, InteractiveServer, and InteractiveWebAssembly modes, including parameter serialization/markers
  • Extends ServerComponentDeserializerTest.cs with cases for closed generic types (GenericTestComponent<T>), including parameters, multiple markers, and string/int type parameters

Written by Cursor Bugbot for commit a8d897e. Configure here.

Copilot AI and others added 2 commits January 25, 2026 11:59
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Assert.NotNull(preambleMarker.PrerenderId);
Assert.Equal("webassembly", preambleMarker.Type);
Assert.Equal(typeof(GenericComponent<string>).Assembly.GetName().Name, preambleMarker.Assembly);
Assert.Equal(typeof(GenericComponent<string>).FullName, preambleMarker.TypeName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong generic type in client mode test assertions

Low Severity

The test CanPrerender_ClosedGenericComponent_ClientMode renders GenericComponent<int> with parameter value 456, but the assertions on lines 837-838 incorrectly check for GenericComponent<string>. The assertions compare against typeof(GenericComponent<string>) when they should use typeof(GenericComponent<int>) to match the component actually being rendered.

Fix in Cursor Fix in Web


var secondDescriptor = descriptors[1];
Assert.Equal(typeof(GenericTestComponent<string>).FullName, secondDescriptor.ComponentType.FullName);
Assert.Equal(0, secondDescriptor.Sequence);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second descriptor sequence assertion incorrectly expects zero

Low Severity

In CanParseMultipleMarkersForClosedGenericComponents, the second descriptor's sequence is asserted to be 0 when it should be 1. The existing CanParseMultipleMarkers test correctly asserts firstDescriptor.Sequence as 0 and secondDescriptor.Sequence as 1, but this new test asserts both as 0.

Fix in Cursor Fix in Web

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