Add test coverage for prerendering closed generic components#5
Conversation
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
|
|
||
| var secondDescriptor = descriptors[1]; | ||
| Assert.Equal(typeof(GenericTestComponent<string>).FullName, secondDescriptor.ComponentType.FullName); | ||
| Assert.Equal(0, secondDescriptor.Sequence); |
There was a problem hiding this comment.
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.
Benchmark PR from agentic-review-benchmarks#5
Note
Expands test coverage to validate closed generic component support across render modes and descriptor deserialization.
GenericComponent.razortest component (@typeparam TValue, parameterValue) used to verify outputEndpointHtmlRendererTest.csfor rendering and prerenderingGenericComponent<T>in static,InteractiveServer, andInteractiveWebAssemblymodes, including parameter serialization/markersServerComponentDeserializerTest.cswith cases for closed generic types (GenericTestComponent<T>), including parameters, multiple markers, and string/int type parametersWritten by Cursor Bugbot for commit a8d897e. Configure here.