Bugfix challenge tags to normal tags after a challenge has ended/deleted (#12341)

* Fix bug in challenge tags not converted to normal tags after challenge ended/deleted

* Added test cases to test bug fix

* Set tag.challenge from String to Boolean in tag model schema

* Update existing test with tag challenge set to boolean instead of string

* Added migration file for converting tag challenge field from string to bool

* Implement suggestions from ilnt

* Use mongoose instead of Mock in migration

* Change from update to bulkwrite

* update users individually

Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
This commit is contained in:
tsukimi2
2020-09-07 22:48:22 +08:00
committed by GitHub
parent 1b25d30ac6
commit b0786647ed
4 changed files with 140 additions and 2 deletions

View File

@@ -159,7 +159,7 @@ describe('POST /challenges/:challengeId/winner/:winnerId', () => {
expect(testTask.challenge.broken).to.eql('CHALLENGE_CLOSED');
expect(testTask.challenge.winner).to.eql(winningUser.profile.name);
expect(challengeTag.challenge).to.eql('false');
expect(challengeTag.challenge).to.eql(false);
});
});
});