kgabryje commented on code in PR #31819:
URL: https://github.com/apache/superset/pull/31819#discussion_r1920591458


##########
superset-frontend/src/components/ListViewCard/ImageLoader.test.tsx:
##########
@@ -37,36 +38,48 @@ describe('ImageLoader', () => {
   const defaultProps = {
     src: '/thumbnail',
     fallback: '/fallback',
+    position: 'top' as BackgroundPosition,
   };
 
-  const factory = (extraProps = {}) => {
-    const props = { ...defaultProps, ...extraProps };
-    return mount(<ImageLoader {...props} />);
-  };
-
-  afterEach(fetchMock.resetHistory);
+  afterEach(() => fetchMock.resetHistory());
 
   it('is a valid element', async () => {
-    const wrapper = factory();
-    await waitForComponentToPaint(wrapper);
-    expect(wrapper.find(ImageLoader)).toExist();
+    await act(async () => {
+      render(<ImageLoader {...defaultProps} />);
+    });
+    expect(screen.getByTestId('image-loader')).toBeVisible();

Review Comment:
   Can we replace using `act` with `await screen.findByTestId`? Same applies to 
other tests in test suite



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