Real-Dev-Squad / website-backend

The backend code for all our website-related apps
https://api.realdevsquad.com/
MIT License
46 stars 201 forks source link

backend/activity-feed: refactor code and add test cases #1982

Closed palakgupta2712 closed 3 months ago

palakgupta2712 commented 3 months ago

Date: 24/04/24

Developer Name: Palak Gupta


Issue Ticket Number

closes https://github.com/Real-Dev-Squad/website-dashboard/issues/700

Description

Refactored the code for formatting the data for activity feed.

Documentation Updated?

Under Feature Flag

Database Changes

Breaking Changes

Development Tested?

Screenshots

Screenshot 1

Test Coverage

Unit tests:-

image
---------------------------------------- --------- ---------- --------- --------- ----------------------------- File % Stmts % Branch % Funcs % Lines Uncovered Line #s

/models
logs.js | 82.44 | 64.61 | 100 | 84.29 | 34-35,61,91-99,106-107,134-135,161-162,244-245
/utils
logs.js | 89.28 | 63 | 86.66 | 89.28 | 34,56,74,112-114

Integration tests:-

image
---------------------------------------- --------- ---------- --------- --------- ----------------------------- File % Stmts % Branch % Funcs % Lines Uncovered Line #s

/controllers logs.js | 83.33 | 90 | 100 | 82.35 | 20-21,57-63,73-74
/models logs.js | 79.06 | 75.38 | 84.21 | 78.15 | 28-29,55,58-69,100-101,120-122,128-129,149-150,155-156,177,186-187,189-190,236-237

Additional Notes

Previous PRs

  1. https://github.com/Real-Dev-Squad/website-backend/pull/1970
  2. https://github.com/Real-Dev-Squad/website-backend/pull/1976

Related Tickets