Skip to content

Functional test coverage: audit report + client smoke tests + Student CRUD e2e - #132

Merged
buzz-code merged 3 commits into
mainfrom
claude/docs-test-coverage-projects-6ex6b1
Aug 12, 2026
Merged

buzz-code merged 3 commits into
mainfrom
claude/docs-test-coverage-projects-6ex6b1

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

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 shared nra-client createResourceTests helper against this app's App, 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 boilerplate GET / → Hello World check.

Testing

  • cd server && yarn test — 97 suites / 919 tests pass
  • cd server && yarn test:e2e — 2 suites / 4 tests pass
  • cd client && yarn test — 29 suites / 192 tests pass

No app code changes were needed — everything passed on first correct run.


Generated by Claude Code

claude added 2 commits August 11, 2026 16:38
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
Copilot AI lite review requested due to automatic review settings August 12, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md functional coverage audit + gaps list
  • Add client/src/entities.test.js React-Admin resource smoke suite via shared createResourceTests
  • Add server/test/student-crud.e2e-spec.ts Student 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
@buzz-code
buzz-code merged commit c838a1f into main Aug 12, 2026
3 checks passed
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.

3 participants