alex-poor commented on PR #40679:
URL: https://github.com/apache/superset/pull/40679#issuecomment-5720719255
Picked up the two suggestions from Bito run #443da9 as well, in 65cb03f.
**Inline import** — agreed, no cycle to justify it; `from babel import
Locale` now sits with the other third-party imports.
**`fetchMock.removeRoutes()` in the dashboard list test** — I tried both
forms you suggested and neither works, so the reset stays, now with a comment
recording why.
Dropping `removeRoutes()` and re-registering under the same name does not
replace the route:
```
fetch-mock: Adding route with same name as existing route.
```
Removing just that route first and re-adding it gets past the throw but
fails the assertion: the replacement is appended after the helper's `CATCH_ALL:
'glob:*'`, which then answers the request and returns `{result: [], count: 0}`.
Same reason the equivalent suggestion on `ChartList.test.tsx` did not hold.
You are right that the reset leaves the other mount-time requests unmatched,
and I would prefer the surgical form — but the helper registers its catch-all
last, so a per-test override can only win by starting from a clean slate.
Making that possible properly means reordering or naming the catch-all in
`DashboardList.testHelpers`, which affects every test in the suite and looks
like its own change.
--
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]