mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
fix: Supply random value as seed so quest collection is random
This commit is contained in:
@@ -379,7 +379,7 @@ describe('Group Model', () => {
|
||||
expect(Group.processCollectionQuest).to.not.be.called;
|
||||
});
|
||||
|
||||
it('calls processCollectionQuest if quest is a boss quest', async () => {
|
||||
it('calls processCollectionQuest if quest is a collection quest', async () => {
|
||||
party.quest.key = 'evilsanta2';
|
||||
await party.save();
|
||||
|
||||
@@ -608,6 +608,27 @@ describe('Group Model', () => {
|
||||
expect(party.sendChat).to.be.calledWith('`Participating Member found nothing.`');
|
||||
});
|
||||
|
||||
it('handles collection quests with multiple items', async () => {
|
||||
progress.collect = 10;
|
||||
party.quest.key = 'evilsanta2';
|
||||
party.quest.active = false;
|
||||
quest = questScrolls.evilsanta2;
|
||||
|
||||
await party.save();
|
||||
await party.startQuest(questLeader);
|
||||
|
||||
await Group.processCollectionQuest({
|
||||
user: participatingMember,
|
||||
progress,
|
||||
quest,
|
||||
group: party,
|
||||
});
|
||||
|
||||
expect(party.sendChat).to.be.calledOnce;
|
||||
expect(party.sendChat).to.be.calledWithMatch(/`Participating Member found/);;
|
||||
expect(party.sendChat).to.be.calledWithMatch(/\d* (Tracks|Broken Twigs)/);
|
||||
});
|
||||
|
||||
it('sends message about victory', async () => {
|
||||
progress.collect = 500;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user