Add test coverage for prerendering closed generic components#15
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.
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.
|
|
||
| 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.
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.
Benchmark PR from qodo-benchmark#86
Note
Expands test coverage to ensure closed generic components render and deserialize correctly across modes.
GenericComponent.razor(@typeparam TValue) used in new endpoint renderer testsGenericComponent<T>in server and WebAssembly modes, including component markers, parameter metadata, and prerendered HTMLGenericTestComponent<T>ServerComponentDeserializerTest.csWritten by Cursor Bugbot for commit ec433a2. Configure here.