Skip to content

test(users): update DELETE test to call /users/:id and assert service…#517

Merged
Qoder-Undefined merged 1 commit into
MERIDIAN-CITY:mainfrom
baedboibidex-cmyk:fix/users-delete-route-test
Jun 22, 2026
Merged

test(users): update DELETE test to call /users/:id and assert service…#517
Qoder-Undefined merged 1 commit into
MERIDIAN-CITY:mainfrom
baedboibidex-cmyk:fix/users-delete-route-test

Conversation

@baedboibidex-cmyk

Copy link
Copy Markdown
Contributor

closes #494
Summary
Fix a failing test in the users controller spec by updating the request path to match the controller route. This is a test-only change that makes the spec call DELETE /users/1 and asserts the service invocation.

Changes
Updated test to call /users/1 instead of /users
Added assertion that userService.deleteUser(1) is called
Files
users.controller.spec.ts — updated test
users.controller.ts — unchanged (kept @delete('/:id'))
How to run locally

Test output (targeted run)
PASS src/users/users.controller.spec.ts
Test Suites: 1 passed, 1 total
Tests: 17 passed, 17 total

Acceptance checklist
Test updated to call DELETE /users/:id
Test asserts userService.deleteUser called with parsed id
Targeted spec passes locally
Commit & branch
Commit: test(users): update DELETE test to call /users/:id and assert service call
Branch: fix/users-delete-route-test
Follow-ups
If a DELETE /users (delete-all) endpoint is desired, open a new issue/PR and implement with appropriate authorization and safeguards.
Optionally add response-body assertions for the delete endpoint if the service returns structured output.

@Qoder-Undefined Qoder-Undefined merged commit 1f6c708 into MERIDIAN-CITY:main Jun 22, 2026
1 check 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.

test(users.controller): DELETE /users returns 404 because route requires :id

2 participants