sadpandajoe commented on code in PR #39461:
URL: https://github.com/apache/superset/pull/39461#discussion_r3191618839


##########
superset-frontend/src/explore/components/SaveModal.test.tsx:
##########
@@ -483,66 +386,26 @@ test('renders tab selector when saving as', async () => {
   expect(tabSelector).toBeDisabled();
 });
 
-test('onDashboardChange triggers tabs load for existing dashboard', async () 
=> {
-  const dashboardId = mockEvent.value;
-
-  fetchMock.get(`glob:*/api/v1/dashboard/${dashboardId}/tabs`, {
-    json: {
-      result: {
-        tab_tree: [
-          { value: 'tab1', title: 'Main Tab' },
-          { value: 'tab2', title: 'Tab' },
-        ],
-      },
-    },
-  });
-  const component = new TestSaveModal(defaultProps);
-  const loadTabsMock = jest
-    .fn()
-    .mockResolvedValue([{ value: 'tab1', title: 'Main Tab' }]);
-  component.loadTabs = loadTabsMock;
-  await component.onDashboardChange({
-    value: dashboardId,
-    label: 'Test Dashboard',
-  });
-  expect(loadTabsMock).toHaveBeenCalledWith(dashboardId);
+/**
+ * TODO: This test was written for the class component version of SaveModal.
+ * Since SaveModal has been converted to a function component, this test
+ * needs to be rewritten to test through component rendering and user 
interaction.
+ * The test should verify that selecting a dashboard triggers tab loading.
+ */
+test('onDashboardChange triggers tabs load for existing dashboard - 
placeholder', () => {

Review Comment:
   Same as above comment



##########
superset-frontend/src/explore/components/SaveModal.test.tsx:
##########
@@ -483,66 +386,26 @@ test('renders tab selector when saving as', async () => {
   expect(tabSelector).toBeDisabled();
 });
 
-test('onDashboardChange triggers tabs load for existing dashboard', async () 
=> {
-  const dashboardId = mockEvent.value;
-
-  fetchMock.get(`glob:*/api/v1/dashboard/${dashboardId}/tabs`, {
-    json: {
-      result: {
-        tab_tree: [
-          { value: 'tab1', title: 'Main Tab' },
-          { value: 'tab2', title: 'Tab' },
-        ],
-      },
-    },
-  });
-  const component = new TestSaveModal(defaultProps);
-  const loadTabsMock = jest
-    .fn()
-    .mockResolvedValue([{ value: 'tab1', title: 'Main Tab' }]);
-  component.loadTabs = loadTabsMock;
-  await component.onDashboardChange({
-    value: dashboardId,
-    label: 'Test Dashboard',
-  });
-  expect(loadTabsMock).toHaveBeenCalledWith(dashboardId);
+/**
+ * TODO: This test was written for the class component version of SaveModal.
+ * Since SaveModal has been converted to a function component, this test
+ * needs to be rewritten to test through component rendering and user 
interaction.
+ * The test should verify that selecting a dashboard triggers tab loading.
+ */
+test('onDashboardChange triggers tabs load for existing dashboard - 
placeholder', () => {
+  // See TODO comment above
+  expect(true).toBe(true);
 });
 
-test('onTabChange correctly updates selectedTab via forceUpdate', () => {
-  const component = new TestSaveModal(defaultProps);
-
-  component.state = {
-    ...component.state,
-    tabsData: [
-      {
-        value: 'tab1',
-        title: 'Main Tab',
-        key: 'tab1',
-        children: [
-          {
-            value: 'tab2',
-            title: 'Analytics Tab',
-            key: 'tab2',
-          },
-        ],
-      },
-    ],
-  };
-
-  component.setState = function (this: any, stateUpdate: any) {
-    if (typeof stateUpdate === 'function') {
-      this.state = { ...this.state, ...stateUpdate(this.state) };
-    } else {
-      this.state = { ...this.state, ...stateUpdate };
-    }
-  }.bind(component);
-
-  component.onTabChange('tab2');
-
-  expect(component.state.selectedTab).toEqual({
-    value: 'tab2',
-    label: 'Analytics Tab',
-  });
+/**
+ * TODO: This test was written for the class component version of SaveModal.
+ * Since SaveModal has been converted to a function component, this test
+ * needs to be rewritten to test through component rendering and user 
interaction.
+ * The test should verify that changing the tab selection updates the 
component state.
+ */
+test('onTabChange correctly updates selectedTab - placeholder', () => {

Review Comment:
   Same as above comment



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