-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deprecated callbacks passed to mongodb, in
post
model (#680)
Contributes to #634. * fix callbacks passed to mongodb, in post model * fix counter of refs to deprecated `usernames` cache cause: some refs were probably not detected earlier, because of complicated callback logic contributes to #580. * fix(codacy): Always provide a base when using parseInt() functions * check for TypeScript errors in `post.js` * fix `Property 'nbPostsPerNewsfeedPage' does not exist on type 'typeof import("/Users/adrienjoly/Code/openwhyd/app/models/config")'` * fix deprecated mongodb options * fix `Cannot read properties of undefined (reading 'nbPostsPerNewsfeedPage')` cf https://github.com/openwhyd/openwhyd/actions/runs/5983938243/job/16234633467?pr=680#step:7:22 * add test: `incrPlayCounter` action should increase the number of plays of the track * add failing test: `incrPlayCounter` action should return the post _id * fix(api): incrPlayCounter action to not return the `post` object anymore !BREAKING * add failing test: `should increase the total number of plays of that track` => make sure that db is cleared between each test * fix test `post api should add a track to a new playlist`, to make it isolated/independant from other tests of the suite * fix test: `should increase the total number of plays of that track`, as `track` documents are created lazily * test should not pass => make `updateByEid` assert that `eId` param is defined * fix test by setting a eId * fix `incrPlayCounter` impl. by fetching the post's eId * playlist tests: prevent side effects between tests * refactor: extract callPlaylistApi * playlist tests: use DUMMY_USER instead of ADMIN_USER * playlist tests: make sure that freshly created playlist is persisted in db * add test: should rename a playlist * add failing test: should update the playlist's name in associated posts * fix: userModel.setPlaylist to await the update of posts * fix test, to match with schema of posts * be more decisive on when to cleanup, in post.api.tests.js * skip tests that cause side effects on other tests example for #684. * fix(sonar): `Promise returned in function argument where a void return was expected.` * 🙌 re-enable all playlist api tests * remove callback from setPlaylist() * add tests for playlist removal and its impact on associated posts * remove callback from unsetPlaylist() * fix some error cases, based on code review * simplify call expression * refactor: move up insertPost() and callPostApi() helpers * add tests for toggleLovePost * reveal missing callbacks in setPostLove * remove callback from setPostLove()
- Loading branch information
1 parent
a37bb5e
commit 8abd8d8
Showing
8 changed files
with
350 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.