diff --git a/tests/test_site.py b/tests/test_site.py index f00651b..a690a76 100644 --- a/tests/test_site.py +++ b/tests/test_site.py @@ -34,4 +34,90 @@ async def test_dashboard_get_authorized(client): assert "My Files" in text +async def test_solutions_get(client): + resp = await client.get("/solutions") + assert resp.status == 200 + text = await resp.text() + assert "Solutions" in text + assert "Powerful Cloud Solutions for Modern Needs" in text + + +async def test_pricing_get(client): + resp = await client.get("/pricing") + assert resp.status == 200 + text = await resp.text() + assert "Find the perfect plan for your needs." in text + + +async def test_security_get(client): + resp = await client.get("/security") + assert resp.status == 200 + text = await resp.text() + assert "Security" in text + assert "Your Data, Our Priority" in text + + +async def test_support_get(client): + resp = await client.get("/support") + assert resp.status == 200 + text = await resp.text() + assert "Support" in text + assert "We're Here to Help You Succeed" in text + + +async def test_use_cases_get(client): + resp = await client.get("/use_cases") + assert resp.status == 200 + text = await resp.text() + assert "Use Cases" in text + assert "Retoor's for Your World: Real Solutions, Real Impact" in text + + +async def test_order_get_unauthorized(client): + resp = await client.get("/order", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" + + +async def test_order_get_authorized(client): + await client.post( + "/register", + data={ + "full_name": "Test User", + "email": "test@example.com", + "password": "password", + "confirm_password": "password", + }, + ) + await client.post( + "/login", data={"email": "test@example.com", "password": "password"} + ) + resp = await client.get("/order") + assert resp.status == 200 + text = await resp.text() + assert "Optimize Your Team's Storage" in text + assert "Total Storage Used:" in text + + +async def test_order_post_authorized(client): + await client.post( + "/register", + data={ + "full_name": "Test User", + "email": "test@example.com", + "password": "password", + "confirm_password": "password", + }, + ) + await client.post( + "/login", data={"email": "test@example.com", "password": "password"} + ) + # Simulate a POST request to the order page (it just re-renders) + resp = await client.post("/order", data={}) + assert resp.status == 200 + text = await resp.text() + assert "Optimize Your Team's Storage" in text + assert "Total Storage Used:" in text + +