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


##########
superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts:
##########
@@ -28,27 +28,36 @@ describe('SupersetClient', () => {
 
   afterEach(() => SupersetClient.reset());
 
-  it('exposes reset, configure, init, get, post, postForm, isAuthenticated, 
and reAuthenticate methods', () => {
+  it('exposes configure, init, get, post, postForm, delete, put, request, 
reset, getGuestToken, getCSRFToken, getUrl, isAuthenticated, and reAuthenticate 
methods', () => {
     expect(typeof SupersetClient.configure).toBe('function');
     expect(typeof SupersetClient.init).toBe('function');
     expect(typeof SupersetClient.get).toBe('function');
     expect(typeof SupersetClient.post).toBe('function');
     expect(typeof SupersetClient.postForm).toBe('function');
-    expect(typeof SupersetClient.isAuthenticated).toBe('function');
-    expect(typeof SupersetClient.reAuthenticate).toBe('function');
-    expect(typeof SupersetClient.getGuestToken).toBe('function');
+    expect(typeof SupersetClient.delete).toBe('function');
+    expect(typeof SupersetClient.put).toBe('function');
     expect(typeof SupersetClient.request).toBe('function');
     expect(typeof SupersetClient.reset).toBe('function');
+    expect(typeof SupersetClient.getGuestToken).toBe('function');
+    expect(typeof SupersetClient.getCSRFToken).toBe('function');
+    expect(typeof SupersetClient.getUrl).toBe('function');
+    expect(typeof SupersetClient.isAuthenticated).toBe('function');
+    expect(typeof SupersetClient.reAuthenticate).toBe('function');
   });
 
-  it('throws if you call init, get, post, postForm, isAuthenticated, or 
reAuthenticate before configure', () => {
+  it('throws if you call init, get, post, postForm, delete, put, request, 
getGuestToken, getCSRFToken, getUrl, isAuthenticated, or reAuthenticate before 
configure', () => {
     expect(SupersetClient.init).toThrow();
     expect(SupersetClient.get).toThrow();
     expect(SupersetClient.post).toThrow();
     expect(SupersetClient.postForm).toThrow();
+    expect(SupersetClient.delete).toThrow();
+    expect(SupersetClient.put).toThrow();
+    expect(SupersetClient.request).toThrow();
+    expect(SupersetClient.getGuestToken).toThrow();
+    expect(SupersetClient.getCSRFToken).toThrow();
+    expect(SupersetClient.getUrl).toThrow();

Review Comment:
   While the test verifies that `getUrl` exists and throws before configuration 
(line 58), there's no functional test that actually calls 
`SupersetClient.getUrl()` after configuration to verify the delegation works 
correctly. Consider adding a test in the "calls appropriate SupersetClient 
methods when configured" test case (starting at line 65) that:
   1. Configures the client with an appRoot
   2. Calls `SupersetClient.getUrl({ endpoint: '/some/path' })`
   3. Verifies the returned URL includes the appRoot prefix
   
   This would match the pattern used for other methods like get, post, delete, 
and put.



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