You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "eschutho (via GitHub)" <gi...@apache.org> on 2025/09/13 01:35:23 UTC

[PR] fix(tests): update SuperChartCore test to handle Ant Design App wrapper [superset]

eschutho opened a new pull request, #35126:
URL: https://github.com/apache/superset/pull/35126

   ## Summary
   - Fixed failing test in `SuperChartCore.test.tsx` that was expecting empty DOM when `chartProps=null`
   - Updated test expectations to account for Ant Design App wrapper that's always present due to SupersetThemeProvider
   
   ## Problem
   The test `does not render if chartProps is null` was failing because:
   - The `SupersetThemeProvider` wraps all content with an Ant Design `App` component
   - This creates a `<div class="ant-app">` element that makes the container never truly empty
   - The test was using `expect(container).toBeEmptyDOMElement()` which was impossible to satisfy
   
   ## Solution
   Updated the test to:
   - Check that no chart component (`.test-component`) is rendered when `chartProps=null`
   - Verify that only the Ant Design App wrapper (`.ant-app`) is present
   - This is more accurate as it tests the actual intended behavior
   
   ## Test Results
   ✅ All SuperChartCore tests now pass (14/14)
   ✅ Specific failing test now passes
   ✅ No other tests were broken
   
   ## Technical Details
   - **Root cause**: SupersetThemeProvider always renders `<App>{children}</App>` 
   - **File**: `packages/superset-ui-core/src/theme/Theme.tsx:246`
   - **Previous expectation**: Container should be completely empty
   - **New expectation**: Container should have App wrapper but no chart content
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tests): update SuperChartCore test to handle Ant Design App wrapper [superset]

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho closed pull request #35126: fix(tests): update SuperChartCore test to handle Ant Design App wrapper
URL: https://github.com/apache/superset/pull/35126


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org