fix(ui): correct OAuth setup page links in integrations dashboard
The oauthLink() function in integrations_dashboard.html returned /dropbox, /google-drive, /onedrive which are not valid routes (404). The actual view routes are /dropbox-setup, /google-drive-setup, /onedrive-setup. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -840,9 +840,9 @@ function integrationsDashboard() {
|
||||
hasFormFields(t) { return TYPES_WITH_FORM_FIELDS.has(t); },
|
||||
|
||||
oauthLink(t) {
|
||||
if (t === 'DROPBOX') return '/dropbox';
|
||||
if (t === 'GOOGLE_DRIVE') return '/google-drive';
|
||||
if (t === 'ONEDRIVE') return '/onedrive';
|
||||
if (t === 'DROPBOX') return '/dropbox-setup';
|
||||
if (t === 'GOOGLE_DRIVE') return '/google-drive-setup';
|
||||
if (t === 'ONEDRIVE') return '/onedrive-setup';
|
||||
return '#';
|
||||
},
|
||||
|
||||
|
||||
@@ -63,6 +63,19 @@ class TestIntegrationsDashboardView:
|
||||
assert response.status_code == 200
|
||||
assert b"integrationsDashboard" in response.content
|
||||
|
||||
def test_integrations_page_oauth_links_point_to_setup_pages(self, client):
|
||||
"""oauthLink() must reference the correct -setup URLs, not bare paths."""
|
||||
response = client.get("/integrations")
|
||||
assert response.status_code == 200
|
||||
body = response.text
|
||||
assert "'/dropbox-setup'" in body or '"/dropbox-setup"' in body
|
||||
assert "'/google-drive-setup'" in body or '"/google-drive-setup"' in body
|
||||
assert "'/onedrive-setup'" in body or '"/onedrive-setup"' in body
|
||||
# Ensure the old broken paths are gone
|
||||
assert "return '/dropbox'" not in body.replace("/dropbox-setup", "")
|
||||
assert "return '/google-drive'" not in body.replace("/google-drive-setup", "")
|
||||
assert "return '/onedrive'" not in body.replace("/onedrive-setup", "")
|
||||
|
||||
def test_integrations_page_contains_quota_indicators(self, client):
|
||||
"""GET /integrations page includes quota labels."""
|
||||
response = client.get("/integrations")
|
||||
|
||||
Reference in New Issue
Block a user