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


##########
tests/integration_tests/core_tests.py:
##########
@@ -953,6 +953,49 @@ def test_dashboard_permalink_returns_404_for_missing_state(
         assert resp.status_code == 404
         assert "Location" not in resp.headers
 
+    def test_extension_view_anonymous_redirects_to_login(self):
+        resp = self.client.get("/extensions/view/my-ext.settings")
+
+        expected_url = "/login/?next=%2Fextensions%2Fview%2Fmy-ext.settings"
+
+        assert resp.status_code == 302
+        assert resp.headers["Location"] == expected_url
+
+    def test_extension_view_authenticated_returns_spa_shell(self):
+        self.login(ADMIN_USERNAME)
+
+        resp = self.client.get("/extensions/view/my-ext.settings")

Review Comment:
   All three Flask tests request the single-segment id `my-ext.settings`, so 
changing `<path:view_id>` back to a plain `<view_id>` converter would keep them 
green while a bookmark or refresh on `/extensions/view/my-ext/settings` (or the 
`%2F` form) 404s before the SPA loads. The Jest multi-segment case only 
exercises React Router, not this route. Could the authenticated test be 
parametrized over a literal-slash and a `%2F` URL asserting 200 and `id="app"`?



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