Skip to content

feat: add generateSlug utility function, tests, and Jest config#352

Merged
yusuftomilola merged 1 commit intoDistinctCodes:mainfrom
dantesb777:feat/generate-slug
Oct 4, 2025
Merged

feat: add generateSlug utility function, tests, and Jest config#352
yusuftomilola merged 1 commit intoDistinctCodes:mainfrom
dantesb777:feat/generate-slug

Conversation

@dantesb777
Copy link
Copy Markdown
Contributor

Summary

This PR adds a utility function generateSlug used to create URL-friendly slugs for text values like assets, categories, and departments.

What's included:

  • generateSlug.ts in frontend/lib/utils
  • ✅ Converts strings to lowercase, removes special characters, replaces spaces with hyphens
  • ✅ Handles accented Unicode characters (e.g., á, ñ)
  • ✅ Unit tests using Jest in generateSlug.test.ts
  • ✅ Jest configuration added via jest.config.js

How to test:

npx jest frontend/lib/utils/generateSlug.test.ts

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 4, 2025

@dantesb777 is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@dantesb777
Copy link
Copy Markdown
Contributor Author

Hi! I've submitted a PR for this issue. All tests passed and it's ready for review. Let me know if I should change anything. Thanks!

@yusuftomilola yusuftomilola merged commit 4eacec1 into DistinctCodes:main Oct 4, 2025
4 of 5 checks passed
@dantesb777 dantesb777 deleted the feat/generate-slug branch October 4, 2025 17:49
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.

2 participants