rusackas commented on code in PR #32958:
URL: https://github.com/apache/superset/pull/32958#discussion_r3717353508


##########
superset-frontend/cypress-base/cypress/e2e/dashboard/shared_dashboard_functions.ts:
##########
@@ -138,6 +138,7 @@ export function prepareDashboardFilters(
             chart_customization_config: [],
             timed_refresh_immune_slices: [],
             expanded_slices: {},
+            expand_all_slices: false,

Review Comment:
   This helper is existing Cypress infra used elsewhere already, migrating it 
to Playwright is a separate effort from this feature PR.



##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.test.tsx:
##########
@@ -145,17 +145,80 @@ test('should render a ChartContainer', () => {
   expect(getByTestId('chart-container')).toBeInTheDocument();
 });
 
-test('should render a description if it has one and isExpanded=true', () => {
-  const { container } = setup(
-    {},
-    {
-      dashboardState: {
-        ...defaultState.dashboardState,
-        expandedSlices: { [props.id]: true },
-      },
-    },
-  );
-  expect(container.querySelector('.slice_description')).toBeInTheDocument();
+describe('no description set', () => {
+  for (const sliceExpanded of [undefined, false, true]) {
+    for (const allExpanded of [undefined, false, true]) {
+      test(`should not render a description, expandedSlices=${sliceExpanded} 
and expandAllSlices=${allExpanded}`, () => {
+        const { container } = setup(
+          {},
+          {
+            dashboardState: {
+              ...defaultState.dashboardState,
+              expandedSlices: { [props.id]: sliceExpanded },
+              expandAllSlices: allExpanded,
+            },
+            sliceEntities: {
+              ...sliceEntities,
+              slices: {
+                [queryId]: {
+                  ...sliceEntities.slices[queryId],
+                  description_markeddown: undefined,
+                  owners: [],
+                  viz_type: VizType.Table,
+                },
+              },
+            },
+          },
+        );
+        expect(
+          container.querySelector('.slice_description'),
+        ).not.toBeInTheDocument();
+      });
+    }
+  }
+});

Review Comment:
   Agreed, flattened both blocks to test.each() so there's no describe() 
wrapper.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to