Closed ae2079 closed 2 months ago
Recent updates include the introduction of new test cases for donation metrics and relevant donations, along with additional properties for donation data interfaces. Furthermore, modifications have been made to existing test cases in the project resolver tests, specifically adjusting the updateId
values. These changes enhance testing coverage and accuracy for donation and project functionalities.
Files | Change Summaries |
---|---|
src/…/donationRepository.test.ts | Added findRelevantDonations function with associated test cases and introduced assertThrowsAsync . |
src/…/donationResolver.test.ts | Added donationMetrics test suite with new cases, along with supporting entities and utilities for testing donation metrics. |
test/testUtils.ts | Added useDonationBox and relevantDonationTxHash properties to CreateDonationData interface. |
src/…/projectResolver.test.ts | Changed updateId values from projectUpdateCount + 1/2 to projectUpdateCount + 10 in editProjectUpdateTestCases and deleteProjectUpdateTestCases . |
Amid the code tall, New tests rise and metrics call. Donations find their place, Projects keep a steady pace. With IDs shuffled, updates blend, Our code's story finds no end. 🐇💻✨
src/resolvers/projectResolver.test.ts (1)
`5495-5495`: **Ensure proper error handling.** The error message 'Project update not found.' should be consistent with other error messages, potentially using a centralized error message constant. ```diff - assert.equal(result.data.errors[0].message, 'Project update not found.'); + assert.equal(result.data.errors[0].message, errorMessages.PROJECT_UPDATE_NOT_FOUND); ``` > Likely invalid or redundant comment.
Thanks @ae2079 LGTM Do these things
* Merge staging to your branch and resolve conflict * Make sure all test cases pass * [Optional] If it's not too hard for you you can run these migrations on your local system (with dump of staging DB that I can send a dump to you if you want to) and see if the migration of filling existing donations works properly or not
I already tested migrations locally and will do two other points you mentioned. thanks @mohammadranjbarz
related to: https://github.com/Giveth/analytics-dashboard/issues/15
Summary by CodeRabbit
Tests
findRelevantDonations
to ensure correct behavior and error handling.donationMetrics()
to validate donation metrics calculation.updateId
values in project resolver tests to improve test accuracy.New Features
useDonationBox
andrelevantDonationTxHash
to the donation creation interface for enhanced donation tracking.Chores