async def test_index_get(client): resp = await client.get("/") assert resp.status == 200 text = await resp.text() assert "Solutions for Everyone" in text assert "Find Your Perfect Plan" in text async def test_dashboard_get_unauthorized(client): resp = await client.get("/dashboard", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_dashboard_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("/dashboard") assert resp.status == 200 text = await resp.text() 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_unauthorized(client): resp = await client.get("/support", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" 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 async def test_terms_get(client): resp = await client.get("/terms") assert resp.status == 200 text = await resp.text() assert "Terms of Service" in text assert "By accessing and using our services, you agree to be bound by these Terms of Service" in text async def test_privacy_get(client): resp = await client.get("/privacy") assert resp.status == 200 text = await resp.text() assert "Privacy Policy" in text assert "This Privacy Policy describes how Retoor's Cloud Solutions collects, uses, and discloses your information" in text async def test_shared_get_unauthorized(client): resp = await client.get("/shared", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_recent_get_unauthorized(client): resp = await client.get("/recent", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_favorites_get_unauthorized(client): resp = await client.get("/favorites", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_trash_get_unauthorized(client): resp = await client.get("/trash", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_file_browser_get_unauthorized(client): resp = await client.get("/files", allow_redirects=False) assert resp.status == 302 assert resp.headers["Location"] == "/login" async def test_file_browser_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("/files") assert resp.status == 200 text = await resp.text() assert "My Files" in text assert "No files found in this directory." in text