Skip to content

test: add unit tests for TagsService, TagsController, and slugify (#202)#299

Open
iyanumajekodunmi756 wants to merge 1 commit into
XStreamRollz:mainfrom
iyanumajekodunmi756:test/tags-service-controller-unit-tests
Open

test: add unit tests for TagsService, TagsController, and slugify (#202)#299
iyanumajekodunmi756 wants to merge 1 commit into
XStreamRollz:mainfrom
iyanumajekodunmi756:test/tags-service-controller-unit-tests

Conversation

@iyanumajekodunmi756

Copy link
Copy Markdown
  • api/src/tags/slugify.spec.ts: 12 cases covering NFD normalisation, diacritics, special chars, unicode, length cap, and non-string input
  • api/src/tags/tags.service.spec.ts: 11 cases covering list pagination (hasMore true/false), attachToStream (new tag, reuse existing slug, whitespace trimming, empty/non-alphanumeric name), and detachFromStream (success, tag not found, tag not attached to stream)
  • api/src/tags/tags.controller.spec.ts: 8 cases covering TagsListController defaults and delegation, StreamTagsController guard reflection, attach delegation, and detach delegation

All 83 tests pass (31 new + 52 existing) across 9 suites.

Closes #202

Summary

Provide a short description of the changes in this PR and the motivation/why.

closes #202

Related issues

Link any related issues. Use Closes #<id> to close issues automatically.

Closes:

Type of change

  • feat
  • fix
  • docs
  • chore
  • test
  • ci

Match the PR title to Conventional Commits: <type>(<scope>): <summary>.

Testing performed

Describe how you tested this change. Include commands, environment, and any setup steps.

Example:

cd api
npm run lint
npm run build
npm test

Screenshots (if applicable)

Attach screenshots or animated GIFs for UI changes.

Checklist — author

  • I rebased onto origin/main and resolved conflicts.
  • I ran the quality gates locally: npm run lint, npm run build, npm test.
  • Title follows Conventional Commits and references the issue (see above).
  • I added/updated tests where applicable and they pass locally.
  • No new TypeScript errors or lint warnings introduced.
  • I updated documentation if the change affects public behavior.
  • Screenshots included for UI changes.

Checklist — reviewer guidance

  • Required checks: lint, build, unit tests, and any package-specific E2E must be green.
  • Request review from CODEOWNER(s) for touched packages.
  • Prefer small, focused PRs. If large, confirm feature-flagging or follow-up tasks.

Follow the full PR process in CONTRIBUTING.md — particularly: sync with main, run quality gates, request a CODEOWNER review, and use squash-and-merge with a Conventional Commit-style squash message.

…treamRollz#202)

- api/src/tags/slugify.spec.ts: 12 cases covering NFD normalisation,
  diacritics, special chars, unicode, length cap, and non-string input
- api/src/tags/tags.service.spec.ts: 11 cases covering list pagination
  (hasMore true/false), attachToStream (new tag, reuse existing slug,
  whitespace trimming, empty/non-alphanumeric name), and detachFromStream
  (success, tag not found, tag not attached to stream)
- api/src/tags/tags.controller.spec.ts: 8 cases covering
  TagsListController defaults and delegation, StreamTagsController guard
  reflection, attach delegation, and detach delegation

All 83 tests pass (31 new + 52 existing) across 9 suites.

Closes XStreamRollz#202
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 TagsService and TagsController unit tests

1 participant