Repository navigation
feat: add solid testing infrastructure + entity config specs - #85
Conversation
…sh, entities.test.js)
New specs using createEntityConfigTests: absenceType, known-absence, lesson, report-group, report-group-session, student-klass-report, teacher-grade-report-status, teacher-salary-report, transportation Also bumps nra-server submodule to include entity-config-tester.ts.
There was a problem hiding this comment.
Pull request overview
This PR wires the repo into a shared testing infrastructure and adds/extends Jest specs that validate server entity-module configs (entity identity, joins, and export headers), plus introduces a centralized endpoint list for shared e2e smoke tests.
Changes:
- Add concise
createEntityConfigTests(...)specs for multiple server entity-module configs. - Replace the repo-local “test all endpoints” shell script with an
endpoints.envfile intended for the shared e2e runner. - Remove the legacy
server/helpers/test-all-endpoints.shscript.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/src/entity-modules/tests/transportation.config.spec.ts | Adds config contract test for Transportation export headers. |
| server/src/entity-modules/tests/teacher-salary-report.config.spec.ts | Adds config contract test covering joins/export joins and export headers. |
| server/src/entity-modules/tests/teacher-grade-report-status.config.spec.ts | Adds export header contract test for the view-entity config. |
| server/src/entity-modules/tests/student-klass-report.config.spec.ts | Adds join/export-join and export header contract test for StudentKlassReport. |
| server/src/entity-modules/tests/report-group.config.spec.ts | Adds join/export-join and export header contract test for ReportGroup. |
| server/src/entity-modules/tests/report-group-session.config.spec.ts | Adds join contract test for ReportGroupSession. |
| server/src/entity-modules/tests/lesson.config.spec.ts | Adds join/export-join and export header contract test for Lesson. |
| server/src/entity-modules/tests/known-absence.config.spec.ts | Adds join/export-join and export header contract test for KnownAbsence. |
| server/src/entity-modules/tests/absenceType.config.spec.ts | Adds export header contract test for AbsenceType. |
| server/helpers/test-all-endpoints.sh | Removes legacy per-repo endpoint smoke-test script. |
| server/helpers/endpoints.env | Adds centralized endpoint list for shared e2e smoke testing. |
| @@ -0,0 +1 @@ | |||
| ENDPOINTS="user att_report att_report_with_report_month grade klass klass_type known_absence lesson student_klass student teacher text student_klass_report student_base_klass student_speciality audit_log import_file report_group report_group_session yemot_call mail_address recieved_mail page report_month teacher_report_status teacher_grade_report_status text_by_user student_percent_report att_report_and_grade student_global_report image student_by_year payment_track teacher_salary_report known_absence_with_report_month grade_name attendance_name att_grade_effect grade_effect_by_user abs_count_effect_by_user lesson_klass_name" | |||
There was a problem hiding this comment.
endpoints.env is missing some endpoints that are registered in EntitiesModule and/or referenced in registerEntityNameMap, so the e2e smoke test list will be incomplete. In particular, transportation (Transportation), absence_type (AbsenceType), and uploaded_file (UploadedFile) appear to be omitted—please add the missing endpoints so all registered entity modules are covered.
| ENDPOINTS="user att_report att_report_with_report_month grade klass klass_type known_absence lesson student_klass student teacher text student_klass_report student_base_klass student_speciality audit_log import_file report_group report_group_session yemot_call mail_address recieved_mail page report_month teacher_report_status teacher_grade_report_status text_by_user student_percent_report att_report_and_grade student_global_report image student_by_year payment_track teacher_salary_report known_absence_with_report_month grade_name attendance_name att_grade_effect grade_effect_by_user abs_count_effect_by_user lesson_klass_name" | |
| ENDPOINTS="user att_report att_report_with_report_month grade klass klass_type known_absence lesson student_klass student teacher text student_klass_report student_base_klass student_speciality audit_log import_file report_group report_group_session yemot_call mail_address recieved_mail page report_month teacher_report_status teacher_grade_report_status text_by_user student_percent_report att_report_and_grade student_global_report image student_by_year payment_track teacher_salary_report known_absence_with_report_month grade_name attendance_name att_grade_effect grade_effect_by_user abs_count_effect_by_user lesson_klass_name transportation absence_type uploaded_file" |
- server/shared (nra-server): 2f339e0 — after feature/solid-testing merge - client/shared (nra-client): 9276a7e — after feature/solid-testing merge
Add transportation, absence_type, uploaded_file which are registered in EntitiesModule but were missing from the ENDPOINTS list.
AppService.getHello() now returns 'Hello World! Server started at <ISO>'. Update the e2e assertion to use a regex pattern, matching the existing unit test assertions in app.service.spec.ts and app.controller.spec.ts.
Summary
Wires the project into the new shared testing infrastructure and adds comprehensive entity config test coverage.
Solid testing infrastructure
server/helpers/endpoints.env— lists all entity endpoints for e2e smoke testingscripts/test_all_endpoints.sh(superseded by shared runner)client/shared→ includescreateResourceTests+entities.test.jsserver/shared→ includesentity-config-tester+ shared e2e scriptsEntity config specs (new)
All previously untested entity configs in
server/src/entity-modules/__tests__/:excellency-date.config.spec.tsgrade.config.spec.tsreport-period.config.spec.tsspecialty-absence.config.spec.tsspecialty.config.spec.tsstudent-specialty.config.spec.tsstudent-type.config.spec.tsstudent.config.spec.tstest-name.config.spec.tsEach spec validates entity class identity,⚠️ Merge order dependency\n> This PR depends on:\n> - nra-server #6 — must be merged first\n> - nra-client #6 — must be merged first\n>\n> After those are merged, bump the submodule refs in this repo to the new
query.join, export headers (first field + count), and export join mutations where applicable.\n\n---\n\n>mainHEAD before merging this PR.