Skip to content

test: add unit tests for DataAnonymizationService (#1281) - #1372

Open
yahayaf84771-afk wants to merge 1 commit into
rinafcode:mainfrom
yahayaf84771-afk:feat/1281-data-anonymization-unit-tests
Open

test: add unit tests for DataAnonymizationService (#1281)#1372
yahayaf84771-afk wants to merge 1 commit into
rinafcode:mainfrom
yahayaf84771-afk:feat/1281-data-anonymization-unit-tests

Conversation

@yahayaf84771-afk

Copy link
Copy Markdown

Summary

Closes #1281

Adds src/common/utils/data-anonymization.service.spec.ts — a focused Jest suite for every public method of DataAnonymizationService.

Coverage

Method Happy-path tests Edge / failure tests
anonymizeUserData default options, custom fields, hashIdentifiers=false, keepEmailDomain=false empty object, 1- and 2-char field values, email without domain, numeric id
anonymizeRecords array of records, custom options passed through empty array, original records not mutated
containsPII all recognised PII field names null value, undefined value, empty object, no PII fields
removePII default fields removed, custom field list empty object, missing fields, original not mutated, empty removal list

Testing

Uses Test.createTestingModule with no external dependencies (service has none). All assertions are pure — no network, DB, or filesystem access.

Checklist

  • Every public method has ≥ 1 test
  • Both success and failure/edge-case paths are asserted
  • No new runtime dependencies introduced
  • Existing Jest config unchanged

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@yahayaf84771-afk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job done so far!
Kindly fix workflow to pass

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.

Add unit tests for data-anonymization service

2 participants