Skip to content

Add test coverage for prerendering closed generic components#15

Open
tomerqodo wants to merge 2 commits intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_add_test_coverage_for_prerendering_closed_generic_components_pr86from
augment_combined_20260121_augment_sentry_coderabbit_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 intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_add_test_coverage_for_prerendering_closed_generic_components_pr86from
augment_combined_20260121_augment_sentry_coderabbit_1_head_add_test_coverage_for_prerendering_closed_generic_components_pr86

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#86

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

augmentcode Bot commented Jan 22, 2026

🤖 Augment PR Summary

Summary: Adds unit-test coverage to ensure prerendering/serialization supports closed generic Blazor components.

Changes:

  • Added new EndpointHtmlRenderer tests for rendering and prerendering closed generic components in static, interactive server, and interactive WebAssembly modes.
  • Introduced a new test component GenericComponent<TValue> for exercising generic parameter binding during prerendering.
  • Extended ServerComponentDeserializer tests to verify descriptors can be deserialized for closed generic component types.
  • Added coverage for passing parameters to closed generic components and validating parameter values on deserialization.

Technical Notes:

  • Uses existing marker/descriptor JSON serialization settings and data-protection unprotect flow to validate server markers.
  • Adds System.Globalization usage to make numeric parameter assertions culture-invariant.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

var preambleMarker = JsonSerializer.Deserialize<ComponentMarker>(preamble, ServerComponentSerializationSettings.JsonSerializationOptions);
Assert.NotNull(preambleMarker.PrerenderId);
Assert.Equal("webassembly", preambleMarker.Type);
Assert.Equal(typeof(GenericComponent<string>).Assembly.GetName().Name, preambleMarker.Assembly);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test prerenders GenericComponent<int> but asserts the marker Assembly/TypeName for GenericComponent<string>, so it won’t validate the rendered closed generic type (and is likely to fail).

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎


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.

In this multi-marker case, the second descriptor’s Sequence is asserted as 0, but CanParseMultipleMarkers expects the second marker to have Sequence == 1 (and CreateMarkers serializes markers in order). This looks inconsistent and likely makes the test incorrect.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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