Skip to content

test(streams): add unit tests for StreamsService and StreamsController#302

Open
coderolisa wants to merge 1 commit into
XStreamRollz:mainfrom
coderolisa:test/streams-unit-tests
Open

test(streams): add unit tests for StreamsService and StreamsController#302
coderolisa wants to merge 1 commit into
XStreamRollz:mainfrom
coderolisa:test/streams-unit-tests

Conversation

@coderolisa

Copy link
Copy Markdown

closes #201
Summary

Added tests: Created api/src/streams/streams.service.spec.ts and api/src/streams/streams.controller.spec.ts.
Service coverage: Tests for StreamsService — create, list (pagination & filtering), findById (NotFound), update (status transitions: inactive→active success, active→active conflict, error→active conflict), and delete (existing removed, non-existent NotFound).
Controller coverage: Tests for StreamsController — verifies each endpoint delegates to StreamsService with correct params (create, list, findById, update, delete). Guards are mocked to avoid side-effects.
Implementation detail: Mocked AuthGuard and StreamOwnershipGuard in the controller spec to prevent environment validation from running during imports.
Validation handling: Tests assert exceptions thrown by service (NotFoundException, ConflictException) for invalid operations.
Verification: Installed dev dependencies and ran the API test suite; all tests pass locally (66 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: Implement StreamsService and StreamsController unit tests

2 participants