Skip to content

Add test coverage for prerendering closed generic components#15

Open
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_add_test_coverage_for_prerendering_closed_generic_components_pr86from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_add_test_coverage_for_prerendering_closed_generic_components_pr86
Open

Add test coverage for prerendering closed generic components#15
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_add_test_coverage_for_prerendering_closed_generic_components_pr86from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_add_test_coverage_for_prerendering_closed_generic_components_pr86

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#86


Note

Expands test coverage to ensure closed generic components render and deserialize correctly across modes.

  • Adds GenericComponent.razor (@typeparam TValue) used in new endpoint renderer tests
  • New EndpointHtmlRenderer tests validate rendering/prerendering of GenericComponent<T> in server and WebAssembly modes, including component markers, parameter metadata, and prerendered HTML
  • Extends ServerComponentDeserializer tests to handle closed generics (with/without parameters and multiple markers) and introduces GenericTestComponent<T>
  • Minor namespace/style adjustment in ServerComponentDeserializerTest.cs

Written by Cursor Bugbot for commit ec433a2. Configure here.

Copilot AI and others added 2 commits January 21, 2026 16:00
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

Test asserts wrong generic type parameter

Medium Severity

The test CanPrerender_ClosedGenericComponent_ClientMode renders GenericComponent<int> with an integer value of 456, but the assertions at lines 837-838 incorrectly verify against typeof(GenericComponent<string>) instead of typeof(GenericComponent<int>). This appears to be a copy-paste error. The test will fail incorrectly since GenericComponent<int>.FullName differs from GenericComponent<string>.FullName.

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.

Test asserts wrong sequence value for second descriptor

Medium Severity

The test CanParseMultipleMarkersForClosedGenericComponents incorrectly asserts that secondDescriptor.Sequence equals 0. Following the pattern established by the existing CanParseMultipleMarkers test (line 164), when multiple markers are created in sequence, the second descriptor's Sequence value is 1, not 0. This copy-paste error means the test will fail when run against correctly functioning code.

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