feat: multi-module improvements across merchant, store, i18n, and customer systems
All checks were successful
All checks were successful
- Fix platform-grouped merchant sidebar menu with core items at root level - Add merchant store management (detail page, create store, team page) - Fix store settings 500 error by removing dead stripe/API tab - Move onboarding translations to module-owned locale files - Fix onboarding banner i18n with server-side rendering + context inheritance - Refactor login language selectors to use languageSelector() function (LANG-002) - Move HTTPException handling to global exception handler in merchant routes (API-003) - Add language selector to all login pages and portal headers - Fix customer module: drop order stats from customer model, add to orders module - Fix admin menu config visibility for super admin platform context - Fix storefront auth and layout issues - Add missing i18n translations for onboarding steps (en/fr/de/lb) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -367,14 +367,17 @@ class TestAdminAuthPlatformSelectionAPI:
|
||||
|
||||
assert response.status_code == 403 # Access denied
|
||||
|
||||
def test_select_platform_as_super_admin_fails(
|
||||
def test_select_platform_as_super_admin_succeeds(
|
||||
self, client, super_admin_headers, test_platform
|
||||
):
|
||||
"""Test that super admin cannot select platform (they don't need to)."""
|
||||
"""Test that super admin can select platform context."""
|
||||
response = client.post(
|
||||
"/api/v1/admin/auth/select-platform",
|
||||
params={"platform_id": test_platform.id},
|
||||
headers=super_admin_headers,
|
||||
)
|
||||
|
||||
assert response.status_code == 401 # Super admins don't need this
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["platform_id"] == test_platform.id
|
||||
assert data["platform_code"] == test_platform.code
|
||||
|
||||
@@ -274,9 +274,14 @@ class TestLanguageResolution:
|
||||
assert result == "de"
|
||||
|
||||
def test_resolve_storefront_enabled_filter(self):
|
||||
"""Test storefront respects enabled languages"""
|
||||
"""Test storefront enabled_languages filters automatic fallback but not explicit choices"""
|
||||
# Explicit user choice (customer_preferred) should be respected
|
||||
# even if not in store's enabled list
|
||||
result = resolve_storefront_language("de", None, None, None, ["en", "fr"])
|
||||
# de is not in enabled list, should fallback
|
||||
assert result == "de"
|
||||
|
||||
# But automatic fallback (browser, store default) should be filtered
|
||||
result = resolve_storefront_language(None, None, None, "de", ["en", "fr"])
|
||||
assert result in ["en", "fr", DEFAULT_LANGUAGE]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user