You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2022/09/09 21:20:21 UTC

[superset] branch master updated: test: Fixes act errors in PopoverSection test (#21416)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d1afbcfb2 test: Fixes act errors in PopoverSection test (#21416)
5d1afbcfb2 is described below

commit 5d1afbcfb2e25487d12d18fe2b598520b201ac36
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Sep 9 18:20:09 2022 -0300

    test: Fixes act errors in PopoverSection test (#21416)
---
 .../src/components/PopoverSection/PopoverSection.test.tsx  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx b/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx
index 2135f6ba46..16952834c1 100644
--- a/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx
+++ b/superset-frontend/src/components/PopoverSection/PopoverSection.test.tsx
@@ -21,23 +21,23 @@ import { render, screen } from 'spec/helpers/testing-library';
 import userEvent from '@testing-library/user-event';
 import PopoverSection from 'src/components/PopoverSection';
 
-test('renders with default props', () => {
+test('renders with default props', async () => {
   render(
     <PopoverSection title="Title">
       <div role="form" />
     </PopoverSection>,
   );
-  expect(screen.getByRole('form')).toBeInTheDocument();
-  expect(screen.getAllByRole('img').length).toBe(1);
+  expect(await screen.findByRole('form')).toBeInTheDocument();
+  expect((await screen.findAllByRole('img')).length).toBe(1);
 });
 
-test('renders tooltip icon', () => {
+test('renders tooltip icon', async () => {
   render(
     <PopoverSection title="Title" info="Tooltip">
       <div role="form" />
     </PopoverSection>,
   );
-  expect(screen.getAllByRole('img').length).toBe(2);
+  expect((await screen.findAllByRole('img')).length).toBe(2);
 });
 
 test('renders a tooltip when hovered', async () => {
@@ -50,13 +50,13 @@ test('renders a tooltip when hovered', async () => {
   expect(await screen.findByRole('tooltip')).toBeInTheDocument();
 });
 
-test('calls onSelect when clicked', () => {
+test('calls onSelect when clicked', async () => {
   const onSelect = jest.fn();
   render(
     <PopoverSection title="Title" onSelect={onSelect}>
       <div role="form" />
     </PopoverSection>,
   );
-  userEvent.click(screen.getByRole('img'));
+  userEvent.click(await screen.findByRole('img'));
   expect(onSelect).toHaveBeenCalled();
 });