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

   <!-- Bito Reply -->
   The flagged issue is correct. The current test only verifies the collapsed 
state (`isDescriptionExpanded='false'`), leaving the expanded state untested 
and vulnerable to regressions where the menu label might desynchronize from the 
actual description state. To resolve this, add a test case that renders the 
component with `isExpanded` set to `true` and asserts that 
`data-is-description-expanded` is `'true'`.
   
   Here is a concise implementation for the test file:
   
   ```tsx
   test('Correct props to "SliceHeaderControls" when expanded', () => {
     render(<SliceHeader {...defaultProps} isExpanded={true} />);
     expect(screen.getByTestId('SliceHeaderControls')).toHaveAttribute(
       'data-is-description-expanded',
       'true',
     );
   });
   ```
   
   There are no other comments on this PR to address. Would you like me to 
check for any other potential test coverage gaps in this file?
   
   
**superset-frontend/src/dashboard/components/SliceHeader/SliceHeader.test.tsx**
   ```
   test('Correct props to "SliceHeaderControls" when expanded', () => {
     render(<SliceHeader {...defaultProps} isExpanded={true} />);
     expect(screen.getByTestId('SliceHeaderControls')).toHaveAttribute(
       'data-is-description-expanded',
       'true',
     );
   });
   ```


-- 
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