TemaDeveloper / TemaDeveloper/personal_planner
test(notes): add an integration test for template→database page creation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Database-backed templates create a NotesDatabase server-side and swap the dbBlock() sentinel(s) for real ids (src/app/api/notes/route.ts), including cross-DB relation rewrites for the roadmap template. Pure helpers are unit-tested and the template-block wiring has invariant tests, but the server creation + sentinel/relation swap path has no integration coverage (it needs Mongo).
Add an integration test (e.g. mongodb-memory-server) that POSTs /api/notes with a multi-DB template (student-dashboard, roadmap) and asserts: the databases are created, the page content's database block ids are real (no sentinels remain), and relation relationDbIds point at the sibling DB's real id.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/app/api/notes/route.ts and the existing unit and template-block invariant tests to understand the POST flow and test setup. Add an integration test using a MongoDB test instance for student-dashboard and roadmap, then verify database creation, real database block ids, and cross-database relationDbIds with no sentinels remaining.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, nextjs, typescript
- Domain
- api, databases, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100