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/07 19:34:53 UTC
[superset] 01/01: 5 act errors removed from PopoverDropdown test
This is an automated email from the ASF dual-hosted git repository.
lyndsi pushed a commit to branch lyndsi/popoverdropdown-act-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 365573189be50ff2e10b73ae4393834cbe385e55
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Wed Sep 7 14:34:28 2022 -0500
5 act errors removed from PopoverDropdown test
---
.../PopoverDropdown/PopoverDropdown.test.tsx | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx b/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx
index 2704e11e0c..23d4a17692 100644
--- a/superset-frontend/src/components/PopoverDropdown/PopoverDropdown.test.tsx
+++ b/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 () => {
render(
<PopoverDropdown
{...defaultProps}
@@ -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 () => {
render(
<PopoverDropdown
{...defaultProps}
@@ -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 () => {
render(<PopoverDropdown {...defaultProps} />);
userEvent.click(screen.getByRole('button'));
- expect(screen.getByText('Option 2')).toBeInTheDocument();
+ expect(await screen.findByText('Option 2')).toBeInTheDocument();
userEvent.click(screen.getByText('Option 2'));
expect(defaultProps.onChange).toHaveBeenCalled();
});