mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fixing Exponential Quest Reward Scrolls (#7800)
* adding quest owner specific rewards. closes #2715 * Updating model to prevent this from being a breaking change. * Removing duplicate translatable string and readding accidentally deleted portion * capitalizing according to pr. * fixing according to comments on pr * removing final mistakes * fixing whitespace * re-adding the onlyOwner field that got deleted when the index.js file was moved and fixed console errors. * moving cleaning of empty obejct for quest owner updates into quest owner updates method * Fixing so tests pass by updating variable name and removing unnecessary parameter definition. * adding a new test and refactoring client side code to use controller method.
This commit is contained in:
@@ -1259,14 +1259,34 @@ describe('Group Model', () => {
|
||||
expect(updatedParticipatingMember.items.hatchingPotions.Shade).to.eql(2);
|
||||
});
|
||||
|
||||
it('awards quests', async () => {
|
||||
it('awards quest scrolls to owner', async () => {
|
||||
let questAwardQuest = questScrolls.vice2;
|
||||
|
||||
await party.finishQuest(questAwardQuest);
|
||||
|
||||
let updatedLeader = await User.findById(questLeader._id);
|
||||
|
||||
expect(updatedLeader.items.quests.vice3).to.eql(1);
|
||||
});
|
||||
|
||||
it('awards non quest leader rewards to quest leader', async () => {
|
||||
let gearQuest = questScrolls.vice3;
|
||||
|
||||
await party.finishQuest(gearQuest);
|
||||
|
||||
let updatedLeader = await User.findById(questLeader._id);
|
||||
|
||||
expect(updatedLeader.items.gear.owned.weapon_special_2).to.eql(true);
|
||||
});
|
||||
|
||||
it('doesn\'t award quest owner rewards to all participants', async () => {
|
||||
let questAwardQuest = questScrolls.vice2;
|
||||
|
||||
await party.finishQuest(questAwardQuest);
|
||||
|
||||
let updatedParticipatingMember = await User.findById(participatingMember._id);
|
||||
|
||||
expect(updatedParticipatingMember.items.quests.vice3).to.eql(1);
|
||||
expect(updatedParticipatingMember.items.quests.vice3).to.not.exist;
|
||||
});
|
||||
|
||||
it('awards pets', async () => {
|
||||
|
||||
Reference in New Issue
Block a user