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/09 03:01:23 UTC

[superset] branch lyndsi/SelectFilterPlugin-act-cleanup created (now fca5e2067a)

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

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


      at fca5e2067a 4 act errors removed from SelectFilterPlugin test

This branch includes the following new commits:

     new fca5e2067a 4 act errors removed from SelectFilterPlugin test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: 4 act errors removed from SelectFilterPlugin test

Posted by ly...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fca5e2067a5718c4af255df36a871e4254aaae39
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Thu Sep 8 22:00:52 2022 -0500

    4 act errors removed from SelectFilterPlugin test
---
 .../components/Select/SelectFilterPlugin.test.tsx  | 32 ++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
index 8c025c9711..f0aa4453b1 100644
--- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
+++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
@@ -24,6 +24,8 @@ import { NULL_STRING } from 'src/utils/common';
 import SelectFilterPlugin from './SelectFilterPlugin';
 import transformProps from './transformProps';
 
+jest.useFakeTimers();
+
 const selectMultipleProps = {
   formData: {
     sortAscending: true,
@@ -86,7 +88,7 @@ describe('SelectFilterPlugin', () => {
     jest.clearAllMocks();
   });
 
-  it('Add multiple values with first render', () => {
+  test('Add multiple values with first render', async () => {
     getWrapper();
     expect(setDataMask).toHaveBeenCalledWith({
       extraFormData: {},
@@ -114,6 +116,7 @@ describe('SelectFilterPlugin', () => {
     });
     userEvent.click(screen.getByRole('combobox'));
     userEvent.click(screen.getByTitle('girl'));
+    expect(await screen.findByTitle(/girl/i)).toBeInTheDocument();
     expect(setDataMask).toHaveBeenCalledWith({
       __cache: {
         value: ['boy'],
@@ -134,9 +137,14 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
-  it('Remove multiple values when required', () => {
+  test('Remove multiple values when required', () => {
     getWrapper();
-    userEvent.click(document.querySelector('[data-icon="close"]')!);
+    userEvent.click(
+      screen.getByRole('img', {
+        name: /close-circle/i,
+        hidden: true,
+      }),
+    );
     expect(setDataMask).toHaveBeenCalledWith({
       __cache: {
         value: ['boy'],
@@ -157,9 +165,14 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
-  it('Remove multiple values when not required', () => {
+  test('Remove multiple values when not required', () => {
     getWrapper({ enableEmptyFilter: false });
-    userEvent.click(document.querySelector('[data-icon="close"]')!);
+    userEvent.click(
+      screen.getByRole('img', {
+        name: /close-circle/i,
+        hidden: true,
+      }),
+    );
     expect(setDataMask).toHaveBeenCalledWith({
       __cache: {
         value: ['boy'],
@@ -172,9 +185,10 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
-  it('Select single values with inverse', () => {
+  test('Select single values with inverse', async () => {
     getWrapper({ multiSelect: false, inverseSelection: true });
     userEvent.click(screen.getByRole('combobox'));
+    expect(await screen.findByTitle('girl')).toBeInTheDocument();
     userEvent.click(screen.getByTitle('girl'));
     expect(setDataMask).toHaveBeenCalledWith({
       __cache: {
@@ -196,9 +210,10 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
-  it('Select single null (empty) value', () => {
+  test('Select single null (empty) value', async () => {
     getWrapper();
     userEvent.click(screen.getByRole('combobox'));
+    expect(await screen.findByRole('combobox')).toBeInTheDocument();
     userEvent.click(screen.getByTitle(NULL_STRING));
     expect(setDataMask).toHaveBeenLastCalledWith({
       __cache: {
@@ -220,9 +235,10 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
-  it('Add ownState with column types when search all options', () => {
+  test('Add ownState with column types when search all options', async () => {
     getWrapper({ searchAllOptions: true, multiSelect: false });
     userEvent.click(screen.getByRole('combobox'));
+    expect(await screen.findByRole('combobox')).toBeInTheDocument();
     userEvent.click(screen.getByTitle('girl'));
     expect(setDataMask).toHaveBeenCalledWith({
       __cache: {