bito-code-review[bot] commented on PR #42853:
URL: https://github.com/apache/superset/pull/42853#issuecomment-5210084404

   <!-- Bito Reply -->
   The test case `redirects using the id when the PUT response slug is empty` 
in `superset-frontend/src/dashboard/actions/dashboardState.test.ts` currently 
mocks the PUT response with `slug: null`. To accurately test the production bug 
where the backend sanitizes a submitted slug like `?` into an empty string 
(`""`), the mock should be updated to return `slug: ""` instead of `slug: null`.
   
   This change will ensure the test exercises the logic where `updatedSlug` 
becomes an empty string, verifying that the code correctly falls back to the 
dashboard `id` for the redirect URL.
   
   **superset-frontend/src/dashboard/actions/dashboardState.test.ts**
   ```
   putStub = jest.spyOn(SupersetClient, 'put').mockResolvedValue({
           json: {
             result: { ...mockDashboardData, id: updatedId, slug: '' },
             last_modified_time: 0,
           },
         } as any);
   ```


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