Skip to content

feat: add compehensive test suite for auth, files, permissions and lifecycle#14

Merged
Aaryan2R merged 2 commits into
Aaryan2R:mainfrom
reory:add-tests
Jun 3, 2026
Merged

feat: add compehensive test suite for auth, files, permissions and lifecycle#14
Aaryan2R merged 2 commits into
Aaryan2R:mainfrom
reory:add-tests

Conversation

@reory

@reory reory commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • User Authentication: Registration and login flow validation.
  • File Management: Full coverage for upload, download, delete, and restore functionality.
  • Permission Enforcement: Role-based access control (Admin vs. Member restrictions).
  • UI & Navigation: Basic route stability and page load verification.
  • Error Handling: Verification of 404 responses for invalid routes and data.
  • Lifecycle Flow: Integration testing covering the end-to-end user journey.

Type of change

  • Bug fix
  • New feature
  • Improvement / refactor
  • Documentation update

How to test

Ensure project dependencies are installed(pytest)
From the project root, run the entire test suite using the command pytest.
Verify that all test files in the tests directory execute and pass successfully.

Checklist

  • I tested this with pytest
  • I kept the PR focused on one change
  • I updated the README if needed

@Aaryan2R

Aaryan2R commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Hey @reory — thank you for this contribution, really appreciate the effort here.

Review summary:

✅ Clean structure — conftest.py fixture with temp DB and monkeypatching is the correct approach
✅ Good coverage across all the areas asked for in #5 — auth, file lifecycle, permissions, error handling, and UI routes
tests/__init__.py included — correct
✅ README testing section added with clear instructions
✅ PR is focused on one thing

One thing I fixed on our end before merging:
pytest was missing from requirements.txt — I have added pytest==8.3.5 in a separate commit so new contributors can run pip install -r requirements.txt and be immediately ready.

Minor notes for future PRs (not blocking this one):

  • test_full_lifecycle.py hardcodes user_id=2 for Alice which assumes the admin was registered first as ID 1. This works for now but could be fragile if registration order changes — something to improve in a follow-up
  • Weak passwords like "246" in test data are fine for tests but worth using something slightly more realistic like "testpass123" for readability

Overall this is solid work and exactly what the project needed. Merging now. 🚀

@Aaryan2R Aaryan2R merged commit 9408544 into Aaryan2R:main Jun 3, 2026
@reory

reory commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@Aaryan2R
Thanks for the review and those tips. Glad I could help. Learning everyday. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants