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 17:07:43 UTC

[superset] branch lyndsi/CollectionControl-act-cleanup created (now 279a20caf9)

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

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


      at 279a20caf9 6 act errors removed from CollectionControl test

This branch includes the following new commits:

     new 279a20caf9 6 act errors removed from CollectionControl 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: 6 act errors removed from CollectionControl 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/CollectionControl-act-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 279a20caf9d1c000b112d79c87865703855eaf82
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Fri Sep 9 12:07:28 2022 -0500

    6 act errors removed from CollectionControl test
---
 .../CollectionControl/CollectionControl.test.tsx   | 27 ++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx b/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
index 53d57030c9..00ece23069 100644
--- a/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
@@ -85,49 +85,58 @@ const createProps = () => ({
   value: [{ key: 'hrYAZ5iBH' }],
 });
 
-test('Should render', () => {
+test('Should render', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
-  expect(screen.getByTestId('CollectionControl')).toBeInTheDocument();
+  expect(await screen.findByTestId('CollectionControl')).toBeInTheDocument();
 });
 
-test('Should show the button with the label', () => {
+test('Should show the button with the label', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
-  expect(screen.getByRole('button', { name: props.label })).toBeInTheDocument();
+  expect(
+    await screen.findByRole('button', { name: props.label }),
+  ).toBeInTheDocument();
   expect(screen.getByRole('button', { name: props.label })).toHaveTextContent(
     props.label,
   );
 });
 
-test('Should have add button', () => {
+test('Should have add button', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
 
+  expect(
+    await screen.findByRole('button', { name: 'plus-large' }),
+  ).toBeInTheDocument();
   expect(props.onChange).toBeCalledTimes(0);
   userEvent.click(screen.getByRole('button', { name: 'plus-large' }));
   expect(props.onChange).toBeCalledWith([{ key: 'hrYAZ5iBH' }, undefined]);
 });
 
-test('Should have remove button', () => {
+test('Should have remove button', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
 
+  expect(
+    await screen.findByRole('button', { name: 'remove-item' }),
+  ).toBeInTheDocument();
   expect(props.onChange).toBeCalledTimes(0);
   userEvent.click(screen.getByRole('button', { name: 'remove-item' }));
   expect(props.onChange).toBeCalledWith([]);
 });
 
-test('Should have SortableDragger icon', () => {
+test('Should have SortableDragger icon', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
-  expect(screen.getByLabelText('drag')).toBeVisible();
+  expect(await screen.findByLabelText('drag')).toBeVisible();
 });
 
-test('Should call Control component', () => {
+test('Should call Control component', async () => {
   const props = createProps();
   render(<CollectionControl {...props} />);
 
+  expect(await screen.findByTestId('TestControl')).toBeInTheDocument();
   expect(props.onChange).toBeCalledTimes(0);
   userEvent.click(screen.getByTestId('TestControl'));
   expect(props.onChange).toBeCalledWith([{ key: 'hrYAZ5iBH' }]);