Copilot commented on code in PR #43023:
URL: https://github.com/apache/superset/pull/43023#discussion_r3754046172


##########
superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.real-autosizer.test.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, waitFor } from 'spec/helpers/testing-library';
+import { DatasourceType } from '@superset-ui/core';
+import DatasourcePanel, {
+  IDatasource,
+} from 'src/explore/components/DatasourcePanel';
+import {
+  columns,
+  metrics,
+} from 'src/explore/components/DatasourcePanel/fixtures';
+import ExploreContainer from 'src/explore/components/ExploreContainer';
+import { DndMetricSelect } from 
'src/explore/components/controls/DndColumnSelectControl';
+import DatasourceControl from 
'src/explore/components/controls/DatasourceControl';
+
+/**
+ * The rest of this test file mocks react-virtualized-auto-sizer to a fixed
+ * height, which bypasses react-window's own size self-measurement path
+ * entirely. This test instead drives a real ResizeObserver callback so the

Review Comment:
   This comment block refers to "the rest of this test file" mocking 
`react-virtualized-auto-sizer`, but this file is standalone. Reword to 
reference the existing `DatasourcePanel.test.tsx` unit tests that mock 
AutoSizer, to avoid confusion.



##########
superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.real-autosizer.test.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, waitFor } from 'spec/helpers/testing-library';
+import { DatasourceType } from '@superset-ui/core';
+import DatasourcePanel, {
+  IDatasource,
+} from 'src/explore/components/DatasourcePanel';
+import {
+  columns,
+  metrics,
+} from 'src/explore/components/DatasourcePanel/fixtures';
+import ExploreContainer from 'src/explore/components/ExploreContainer';
+import { DndMetricSelect } from 
'src/explore/components/controls/DndColumnSelectControl';
+import DatasourceControl from 
'src/explore/components/controls/DatasourceControl';
+
+/**
+ * The rest of this test file mocks react-virtualized-auto-sizer to a fixed
+ * height, which bypasses react-window's own size self-measurement path
+ * entirely. This test instead drives a real ResizeObserver callback so the
+ * panel renders through the same AutoSizer -> react-window List pipeline
+ * the browser uses, to guard against regressions like
+ * https://github.com/apache/superset/issues/43008.
+ */
+class FakeResizeObserver implements ResizeObserver {

Review Comment:
   `FakeResizeObserver` uses `implements ResizeObserver`, but the class doesn't 
fully match the DOM interface shape; this can fail TypeScript type-checking. 
Other tests in the repo stub `window.ResizeObserver` without `implements` to 
avoid this mismatch.



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