bito-code-review[bot] commented on PR #41124:
URL: https://github.com/apache/superset/pull/41124#issuecomment-4725891289

   <!-- Bito Reply -->
   The flagged issue is correct. The newly added test functions in 
`tests/unit_tests/views/test_base.py` (or rather, the tests added in 
`superset-frontend/packages/superset-ui-core/src/components/TelemetryPixel/TelemetryPixel.test.tsx`
 as per the diff) lack the required docstrings. 
   
   To resolve this, add a brief docstring to each test function. Below is the 
corrected code for the new tests:
   
   ```tsx
   test('should NOT render the pixel link when disabled at runtime', () => {
     /** Tests that the telemetry pixel is not rendered when explicitly 
disabled. */
     process.env.SCARF_ANALYTICS = 'true';
     render(<TelemetryPixel enabled={false} />);
   
     const image = document.querySelector('img[src*="scarf.sh"]');
     expect(image).not.toBeInTheDocument();
   });
   
   test('should render the pixel link when enabled at runtime', () => {
     /** Tests that the telemetry pixel is rendered when enabled. */
     process.env.SCARF_ANALYTICS = 'true';
     render(<TelemetryPixel enabled />);
   
     const image = document.querySelector('img[src*="scarf.sh"]');
     expect(image).toBeInTheDocument();
   });
   ```
   
   There are no other review comments in this PR. Would you like me to check 
for any other potential issues or improvements in the modified files?
   
   
**superset-frontend/packages/superset-ui-core/src/components/TelemetryPixel/TelemetryPixel.test.tsx**
   ```
   test('should NOT render the pixel link when disabled at runtime', () => {
     /** Tests that the telemetry pixel is not rendered when explicitly 
disabled. */
     process.env.SCARF_ANALYTICS = 'true';
     render(<TelemetryPixel enabled={false} />);
   
     const image = document.querySelector('img[src*="scarf.sh"]');
     expect(image).not.toBeInTheDocument();
   });
   
   test('should render the pixel link when enabled at runtime', () => {
     /** Tests that the telemetry pixel is rendered when enabled. */
     process.env.SCARF_ANALYTICS = 'true';
     render(<TelemetryPixel enabled />);
   
     const image = document.querySelector('img[src*="scarf.sh"]');
     expect(image).toBeInTheDocument();
   });
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to