TemaDeveloper / TemaDeveloper/personal_planner

test(notes): add an integration test for template→database page creation

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.