You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/09/07 20:03:00 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #21361: test: Fix act errors in PopoverDropdown test

michael-s-molina commented on code in PR #21361:
URL: https://github.com/apache/superset/pull/21361#discussion_r965223319


##########
superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx:
##########
@@ -36,19 +36,19 @@ const defaultProps: PopoverDropdownProps = {
   onChange: jest.fn(),
 };
 
-test('renders with default props', () => {
+it('renders with default props', async () => {

Review Comment:
   ```suggestion
   test('renders with default props', async () => {
   ```



##########
superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx:
##########
@@ -59,10 +59,10 @@ test('renders with custom button', () => {
       )}
     />,
   );
-  expect(screen.getByText('Custom Option 1')).toBeInTheDocument();
+  expect(await screen.findByText('Custom Option 1')).toBeInTheDocument();
 });
 
-test('renders with custom option', () => {
+it('renders with custom option', async () => {

Review Comment:
   ```suggestion
   test('renders with custom option', async () => {
   ```



##########
superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx:
##########
@@ -74,13 +74,13 @@ test('renders with custom option', () => {
     />,
   );
   userEvent.click(screen.getByRole('button'));
-  expect(screen.getByText('Custom Option 1')).toBeInTheDocument();
+  expect(await screen.findByText('Custom Option 1')).toBeInTheDocument();
 });
 
-test('triggers onChange', () => {
+it('triggers onChange', async () => {

Review Comment:
   ```suggestion
   test('triggers onChange', async () => {
   ```



##########
superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx:
##########
@@ -36,19 +36,19 @@ const defaultProps: PopoverDropdownProps = {
   onChange: jest.fn(),
 };
 
-test('renders with default props', () => {
+it('renders with default props', async () => {
   render(<PopoverDropdown {...defaultProps} />);
-  expect(screen.getByRole('button')).toBeInTheDocument();
+  expect(await screen.findByRole('button')).toBeInTheDocument();
   expect(screen.getByRole('button')).toHaveTextContent('Option 1');
 });
 
-test('renders the menu on click', () => {
+it('renders the menu on click', async () => {

Review Comment:
   ```suggestion
   test('renders the menu on click', async () => {
   ```



##########
superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx:
##########
@@ -36,19 +36,19 @@ const defaultProps: PopoverDropdownProps = {
   onChange: jest.fn(),
 };
 
-test('renders with default props', () => {
+it('renders with default props', async () => {
   render(<PopoverDropdown {...defaultProps} />);
-  expect(screen.getByRole('button')).toBeInTheDocument();
+  expect(await screen.findByRole('button')).toBeInTheDocument();
   expect(screen.getByRole('button')).toHaveTextContent('Option 1');
 });
 
-test('renders the menu on click', () => {
+it('renders the menu on click', async () => {
   render(<PopoverDropdown {...defaultProps} />);
   userEvent.click(screen.getByRole('button'));
-  expect(screen.getByRole('menu')).toBeInTheDocument();
+  expect(await screen.findByRole('menu')).toBeInTheDocument();
 });
 
-test('renders with custom button', () => {
+it('renders with custom button', async () => {

Review Comment:
   ```suggestion
   test('renders with custom button', async () => {
   ```



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