eschutho commented on code in PR #28359:
URL: https://github.com/apache/superset/pull/28359#discussion_r1591522716


##########
superset-frontend/packages/superset-ui-core/test/chart/components/FallbackComponent.test.tsx:
##########
@@ -18,42 +18,49 @@
  */
 
 import React from 'react';
-import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
+import { ThemeProvider, supersetTheme } from '../../../src/style';
+
 import FallbackComponent from 
'../../../src/chart/components/FallbackComponent';
 
-describe('FallbackComponent', () => {
-  const ERROR = new Error('CaffeineOverLoadException');
-  const STACK_TRACE = 'Error at line 1: x.drink(coffee)';
+const ERROR = new Error('CaffeineOverLoadException');
+const STACK_TRACE = 'Error at line 1: x.drink(coffee)';
 
-  it('renders error and stack trace', () => {
-    const wrapper = shallow(
-      <FallbackComponent componentStack={STACK_TRACE} error={ERROR} />,
-    );
-    const messages = wrapper.find('code');
-    expect(messages).toHaveLength(2);
-    expect(messages.at(0).text()).toEqual('Error: CaffeineOverLoadException');
-    expect(messages.at(1).text()).toEqual('Error at line 1: x.drink(coffee)');
-  });
+test('renders error and stack trace', () => {
+  const { getByText } = render(
+    <ThemeProvider theme={supersetTheme}>
+      <FallbackComponent componentStack={STACK_TRACE} error={ERROR} />
+    </ThemeProvider>,

Review Comment:
   just a nit and not a blocker, but you can dry up this render function here 
if you want. 



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