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

[superset] 01/01: Fixes 3 act errors in ExploreChartPanel test

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

lyndsi pushed a commit to branch lyndsi/explorechartpanel-act-cleanup-II
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 6f2323fc069dcee914db789aaa460c9aea8cd1a8
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Tue Sep 13 11:04:20 2022 -0500

    Fixes 3 act errors in ExploreChartPanel test
---
 .../src/explore/components/ExploreChartPanel.test.jsx         | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/src/explore/components/ExploreChartPanel.test.jsx b/superset-frontend/src/explore/components/ExploreChartPanel.test.jsx
index a589e45f22..63e139e755 100644
--- a/superset-frontend/src/explore/components/ExploreChartPanel.test.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartPanel.test.jsx
@@ -18,7 +18,7 @@
  */
 import React from 'react';
 import userEvent from '@testing-library/user-event';
-import { render, screen } from 'spec/helpers/testing-library';
+import { render, screen, within } from 'spec/helpers/testing-library';
 import { getChartMetadataRegistry, ChartMetadata } from '@superset-ui/core';
 import ChartContainer from 'src/explore/components/ExploreChartPanel';
 import { setItem, LocalStorageKeys } from 'src/utils/localStorageHelpers';
@@ -158,9 +158,14 @@ describe('ChartContainer', () => {
     const { container } = render(<ChartContainer {...props} />, {
       useRedux: true,
     });
+    const tabpanel = screen.getByRole('tabpanel', { name: /results/i });
+    expect(await within(tabpanel).findByText(/0 rows/i)).toBeInTheDocument();
+
     const gutter = container.querySelector('.gutter');
-    expect(window.getComputedStyle(gutter).display).toBe('block');
+    expect(gutter).toBeVisible();
+
     userEvent.click(screen.getByLabelText('Collapse data panel'));
-    expect(window.getComputedStyle(gutter).display).toBe('none');
+    expect(await screen.findByRole('timer')).toBeInTheDocument();
+    expect(gutter).not.toBeVisible();
   });
 });