mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
* Updated collection quest tests for no found items. Single-item quests state [user] found no [items]. instead of [user] found nothing. If a quest has two items, the chat message is [user] found no [item1] and no [item2]. * Collection quest messages changed from [user] found nothing to [user] found no [item] * Tests for no collection quest items found changed to [user] found 0 [item1], 0 [item2] * Changed chat messages for no found collection quest items to [user] found 0 [item1], 0 [item2] * Sort items alphabetically in multi-item quests so that it always returns the same string * Formatting updates to conform to test specifications (for collection quest progress reports with no items found * Simplified handling of items not found: any items not found are added to the list of found items with quantity 0 for reporting in the group chat. This also causes all items to appear, in the list, even if only one type is found in a multi-item quest. * Test the group chat message when no items are found in multi-item quests. Test succes no longer depends on the order items are listed.
This commit is contained in:
committed by
Blade Barringer
parent
b8878df6bd
commit
923b6c495e
@@ -350,7 +350,25 @@ describe('Group Model', () => {
|
||||
party = await Group.findOne({_id: party._id});
|
||||
|
||||
expect(Group.prototype.sendChat).to.be.calledOnce;
|
||||
expect(Group.prototype.sendChat).to.be.calledWith('`Participating Member found nothing.`');
|
||||
expect(Group.prototype.sendChat).to.be.calledWith('`Participating Member found 0 Bars of Soap.`');
|
||||
});
|
||||
|
||||
it('sends a chat message if no progress is made on quest with multiple items', async () => {
|
||||
progress.collectedItems = 0;
|
||||
party.quest.key = 'dilatoryDistress1';
|
||||
party.quest.active = false;
|
||||
|
||||
await party.startQuest(questLeader);
|
||||
await party.save();
|
||||
|
||||
await Group.processQuestProgress(participatingMember, progress);
|
||||
|
||||
party = await Group.findOne({_id: party._id});
|
||||
|
||||
expect(Group.prototype.sendChat).to.be.calledOnce;
|
||||
expect(Group.prototype.sendChat).to.be.calledWithMatch(/`Participating Member found/);
|
||||
expect(Group.prototype.sendChat).to.be.calledWithMatch(/0 Blue Fins/);
|
||||
expect(Group.prototype.sendChat).to.be.calledWithMatch(/0 Fire Coral/);
|
||||
});
|
||||
|
||||
it('handles collection quests with multiple items', async () => {
|
||||
|
||||
Reference in New Issue
Block a user