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


##########
superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts:
##########
@@ -735,6 +735,24 @@ describe('SupersetClientClass', () => {
       },
     );
 
+    test('makes postForm request to an absolute url without adding the app 
root', async () => {
+      client = new SupersetClientClass({ protocol, host, appRoot: '/prefix' });
+      await client.init();
+      await client.postForm({ url: 'http://localhost/explore/' }, {});
+
+      const hiddenForm = createElement.mock.results[0].value;
+      expect(hiddenForm.action).toBe('http://localhost/explore/');

Review Comment:
   The client is configured for `https://host` while jsdom's page origin is 
`http://localhost`, so this test only passes via the page-origin branch of the 
allowlist. If the `${this.protocol}//${this.host}` entry were dropped or 
mistyped, every test here would still pass, yet an embedded or cross-origin 
client posting to its own configured host would start throwing. Could you add a 
case like `postForm({ url: 'https://host/explore/' }, {})` that asserts the 
form action is `https://host/explore/`?



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