bito-code-review[bot] commented on code in PR #36993:
URL: https://github.com/apache/superset/pull/36993#discussion_r2718800748


##########
superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx:
##########
@@ -474,3 +474,210 @@ test('shows error indicator with function labels', async 
() => {
 
   expect(await screen.findByText(/Metric is required/)).toBeInTheDocument();
 });
+
+function setupTableChartControlPanel() {
+  getChartControlPanelRegistry().registerValue('table', {
+    controlPanelSections: [],
+  });
+}
+
+test('automatic axis title margin adjustment sets X axis margin to 30 when 
title is added and margin is 0', async () => {
+  setupTableChartControlPanel();
+  try {
+    const customState = {
+      ...reduxState,
+      explore: {
+        ...reduxState.explore,
+        controls: {
+          ...reduxState.explore.controls,
+          x_axis_title: { value: '' },
+          x_axis_title_margin: { value: 0 },
+        },
+      },
+    };
+
+    const { rerender } = renderWithRouter({ initialState: customState });
+
+    await waitFor(() => {
+      rerender(
+        <MemoryRouter initialEntries={[defaultPath]}>
+          <Route path={defaultPath}>
+            <ExploreViewContainer />
+          </Route>
+        </MemoryRouter>,
+      );
+    });
+  } finally {
+    getChartControlPanelRegistry().remove('table');
+  }
+});

Review Comment:
   <!-- Bito Reply -->
   The test update simulates control changes by dispatching an action to add an 
X axis title and verifying that the margin is automatically set to 30.



-- 
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