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


##########
superset-frontend/packages/superset-ui-core/src/components/antdDomContract.test.tsx:
##########
@@ -216,13 +216,30 @@ test('Collapse panel/body classes (Collapse.tsx, 
VizTypeGallery, config modals)'
   expect(classes).not.toContain('ant-collapse-content-box');
 });
 
-test('Modal body class (many *.styles.ts modal overrides target it)', () => {
+test('Modal section classes (superset-ui-core Modal + per-modal spacing 
overrides)', () => {
+  // antd 6 renamed the modal box wrapper `.ant-modal-content` -> 
`.ant-modal-container`.
+  // The shared Modal (Modal/Modal.tsx) resets its padding to 0 and makes it a 
flex
+  // column; DatasourceModal and the native-filter ConfigModal size it too. 
When the
+  // class went stale the reset stopped matching and the box regained antd's 
default
+  // contentPadding, inflating every "properties" modal's spacing (SC-114841). 
The
+  // header/body/footer names are unchanged and carry the rest of the spacing.
   render(
-    <Modal open title="t">
+    <Modal open title="t" footer={<button type="button">ok</button>}>
       body
     </Modal>,
   );
-  expect(antClasses(document.body)).toContain('ant-modal-body');
+  const classes = antClasses(document.body);
+  expect(classes).toEqual(
+    expect.arrayContaining([
+      'ant-modal-container',
+      'ant-modal-header',
+      'ant-modal-title',
+      'ant-modal-body',
+      'ant-modal-footer',
+      'ant-modal-close',
+    ]),
+  );
+  expect(classes).not.toContain('ant-modal-content');

Review Comment:
   This test asserts `.ant-modal-content` is no longer present anywhere in the 
rendered Modal DOM, but the repo still has multiple runtime/test selectors that 
rely on `.ant-modal-content` existing (e.g. Playwright docs screenshot 
generator and Cypress directory locators). If this contract is correct for antd 
6, those selectors will stop matching and can break screenshot generation / E2E 
helpers; they should be updated to `.ant-modal-container` (or a dual-selector 
during transition).



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