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:56:08 UTC

[superset] 01/01: 5 act errors removed from AnnotationLayer test

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

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

commit c07b89a7cfbc1def9e1d8b9ae73a0924d2106a2e
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Fri Sep 9 12:55:48 2022 -0500

    5 act errors removed from AnnotationLayer test
---
 .../AnnotationLayerControl/AnnotationLayer.test.tsx   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
index ed8ae44339..b9fc64a4c2 100644
--- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
+++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
@@ -78,7 +78,7 @@ test('renders extra checkboxes when type is time series', async () => {
   userEvent.click(screen.getAllByText('Formula')[0]);
   userEvent.click(screen.getByText('Time series'));
   expect(
-    screen.getByRole('button', { name: 'Show Markers' }),
+    await screen.findByRole('button', { name: 'Show Markers' }),
   ).toBeInTheDocument();
   expect(screen.getByRole('button', { name: 'Hide Line' })).toBeInTheDocument();
 });
@@ -86,7 +86,7 @@ test('renders extra checkboxes when type is time series', async () => {
 test('enables apply and ok buttons', async () => {
   const { container } = render(<AnnotationLayer {...defaultProps} />);
 
-  waitFor(() => {
+  await waitFor(() => {
     expect(container).toBeInTheDocument();
   });
 
@@ -99,7 +99,7 @@ test('enables apply and ok buttons', async () => {
   userEvent.type(nameInput, 'Name');
   userEvent.type(formulaInput, '2x');
 
-  waitFor(() => {
+  await waitFor(() => {
     expect(screen.getByRole('button', { name: 'Apply' })).toBeEnabled();
     expect(screen.getByRole('button', { name: 'OK' })).toBeEnabled();
   });
@@ -150,13 +150,13 @@ test('renders chart options', async () => {
     screen.getByRole('combobox', { name: 'Annotation source type' }),
   );
   userEvent.click(screen.getByText('Superset annotation'));
-  expect(screen.getByText('Annotation layer')).toBeInTheDocument();
+  expect(await screen.findByText('Annotation layer')).toBeInTheDocument();
 
   userEvent.click(
     screen.getByRole('combobox', { name: 'Annotation source type' }),
   );
   userEvent.click(screen.getByText('Table'));
-  expect(screen.getByText('Chart')).toBeInTheDocument();
+  expect(await screen.findByText('Chart')).toBeInTheDocument();
 });
 
 test('keeps apply disabled when missing required fields', async () => {
@@ -167,25 +167,26 @@ test('keeps apply disabled when missing required fields', async () => {
   userEvent.click(
     screen.getByRole('combobox', { name: 'Annotation layer value' }),
   );
-  userEvent.click(await screen.findByText('Chart A'));
-  expect(
-    screen.getByText('Annotation Slice Configuration'),
-  ).toBeInTheDocument();
+  expect(await screen.findByText('Chart A')).toBeInTheDocument();
+  userEvent.click(screen.getByText('Chart A'));
 
   userEvent.click(screen.getByRole('button', { name: 'Automatic Color' }));
   userEvent.click(
     screen.getByRole('combobox', { name: 'Annotation layer title column' }),
   );
+  expect(await screen.findByText(/none/i)).toBeInTheDocument();
   userEvent.click(screen.getByText('None'));
   userEvent.click(screen.getByText('Style'));
   userEvent.click(
     screen.getByRole('combobox', { name: 'Annotation layer stroke' }),
   );
+  expect(await screen.findByText('Dashed')).toBeInTheDocument();
   userEvent.click(screen.getByText('Dashed'));
   userEvent.click(screen.getByText('Opacity'));
   userEvent.click(
     screen.getByRole('combobox', { name: 'Annotation layer opacity' }),
   );
+  expect(await screen.findByText(/0.5/i)).toBeInTheDocument();
   userEvent.click(screen.getByText('0.5'));
 
   const checkboxes = screen.getAllByRole('checkbox');