Repository navigation
Functional test coverage: audit report + client smoke tests + Student CRUD e2e - #132
Merged
Merged
Conversation
Documents what user-facing functionality is actually exercised by automated tests (client + server), vs. gaps and risk areas. Not a line/function coverage report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017YepEQ4PfrEhS2L8imLLRe
Phase 1: wire the shared createResourceTests helper against this app's App, smoke-testing every registered resource's list page. Phase 4: pilot HTTP-level CRUD e2e for Student (create/list/update/ delete over real HTTP against the in-memory test DB), following the pattern already used in dnd-management-nra. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017YepEQ4PfrEhS2L8imLLRe
There was a problem hiding this comment.
Pull request overview
Add functional test coverage audit doc. Add client resource smoke tests. Add server Student CRUD HTTP e2e test.
Changes:
- Add
TEST_COVERAGE.mdfunctional coverage audit + gaps list - Add
client/src/entities.test.jsReact-Admin resource smoke suite via sharedcreateResourceTests - Add
server/test/student-crud.e2e-spec.tsStudent create/list/update/delete e2e over real HTTP
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| TEST_COVERAGE.md | Document functional coverage status + top gaps |
| client/src/entities.test.js | Wire shared resource smoke tests against app App |
| server/test/student-crud.e2e-spec.ts | Add Student CRUD lifecycle e2e coverage |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+13
to
+34
| let cookie: string; | ||
|
|
||
| beforeAll(async () => { | ||
| const moduleFixture = await Test.createTestingModule({ imports: [AppModule] }).compile(); | ||
| app = moduleFixture.createNestApplication(); | ||
| app.use(cookieParser()); | ||
| await app.init(); | ||
| dataSource = moduleFixture.get(DataSource); | ||
| httpUtils = new HttpTestUtils(app); | ||
|
|
||
| const registerRes = await httpUtils | ||
| .post('/auth/register', { username: 'e2e_student_user', password: 'TestPass_123', name: 'E2E' }) | ||
| .expect(200); | ||
| cookie = registerRes.headers['set-cookie'][0].match(/Authentication=[^;]+/)[0]; | ||
| }); | ||
|
|
||
| afterAll(async () => { | ||
| if (dataSource?.isInitialized) { | ||
| await dataSource.destroy(); | ||
| } | ||
| await app.close(); | ||
| }); |
…h coverage doc
- Close moduleFixture in afterAll (previously only app/dataSource were
closed, leaving Nest resources open between e2e suites).
- Guard cookie extraction from /auth/register with a clear error
instead of a bare TypeError if the Set-Cookie header is ever
missing or reshaped.
- Normalize the list-response assertion (asList helper) so it doesn't
assume a plain array if the CRUD layer ever returns a paginated
{ data: [...] } shape instead.
- Update TEST_COVERAGE.md to reflect the client smoke tests and
Student CRUD e2e added earlier in this PR (was still describing
the pre-PR state).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017YepEQ4PfrEhS2L8imLLRe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Functional test coverage audit for this app, plus the highest-value gaps closed.
TEST_COVERAGE.md— audits what user-facing functionality (not lines/functions) is actually exercised by automated tests, client and server, with gaps called out explicitly.client/src/entities.test.js— wires the sharednra-clientcreateResourceTestshelper against this app'sApp, smoke-testing every registered resource's list page. Previously the only client test was a one-line<App/>render check.server/test/student-crud.e2e-spec.ts— pilot HTTP-level e2e for Student: create → list → update → delete over real HTTP against the in-memory test DB. Previously the only "e2e" test was a boilerplateGET / → Hello Worldcheck.Testing
cd server && yarn test— 97 suites / 919 tests passcd server && yarn test:e2e— 2 suites / 4 tests passcd client && yarn test— 29 suites / 192 tests passNo app code changes were needed — everything passed on first correct run.
Generated by Claude Code