Files
wizarr/tests/test_pre_wizard_endpoint.py
engels74 d0df4c6d5d feat: wizard step refactor into pre/post wizard steps
Changes:
  - Pre/post invitation wizard phases
  - Phase-aware routing (/pre-wizard/*, /post-wizard/*)
  - Phase indicator badges (visual categorization)
  - Dynamic completion button behavior
  - Two-column admin layout with category drag-and-drop
  - Invite code management service
  - Enhanced wizard export/import
  - Comprehensive test coverage (17 new test files)
2025-10-16 15:28:48 +02:00

34 lines
1.3 KiB
Python

"""
Unit tests for pre-wizard endpoint.
Tests verify that the pre-wizard routes are properly registered and handle basic cases.
"""
from app.services.invite_code_manager import InviteCodeManager
class TestPreWizardRouteRegistration:
"""Test that pre-wizard routes are properly registered."""
def test_pre_wizard_route_exists(self, app):
"""Test that /wizard/pre-wizard route is registered."""
with app.app_context():
rules = [rule.rule for rule in app.url_map.iter_rules()]
assert "/wizard/pre-wizard" in rules
assert "/wizard/pre-wizard/<int:idx>" in rules
def test_pre_wizard_redirects_without_invite_code(self, app, client):
"""Test that accessing pre-wizard without invite code redirects to home."""
response = client.get("/wizard/pre-wizard", follow_redirects=False)
assert response.status_code == 302
assert response.location == "/"
def test_pre_wizard_redirects_with_invalid_invite_code(self, app, client):
"""Test that accessing pre-wizard with invalid code redirects to home."""
with client.session_transaction():
InviteCodeManager.store_invite_code("INVALID123")
response = client.get("/wizard/pre-wizard", follow_redirects=False)
assert response.status_code == 302
assert response.location == "/"