|
|
|
|
|
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 "Welcome back, Test User!" in 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(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
|
|
|
|
|
|
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(client):
|
|
resp = await client.get("/shared")
|
|
assert resp.status == 200
|
|
text = await resp.text()
|
|
assert "Shared with me" in text
|
|
assert "Files and folders that have been shared with you will appear here." in text
|
|
|
|
|
|
async def test_recent_get(client):
|
|
resp = await client.get("/recent")
|
|
assert resp.status == 200
|
|
text = await resp.text()
|
|
assert "Recent Files" in text
|
|
assert "Your recently accessed files will appear here." in text
|
|
|
|
|
|
async def test_favorites_get(client):
|
|
resp = await client.get("/favorites")
|
|
assert resp.status == 200
|
|
text = await resp.text()
|
|
assert "Favorites" in text
|
|
assert "Your favorite files and folders will appear here." in text
|
|
|
|
|
|
async def test_trash_get(client):
|
|
resp = await client.get("/trash")
|
|
assert resp.status == 200
|
|
text = await resp.text()
|
|
assert "Trash" in text
|
|
assert "Files and folders you have deleted will appear here." in text
|
|
|
|
|
|
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 "File Browser" in text
|
|
# Check for some expected files from the project directory
|
|
assert "example.jpg" in text
|
|
assert "rexample7.jpg" in text
|
|
|
|
|
|
|