mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Multiple checks for pinnedItems (#11031)
* remove null/undefined entries from pinnedItems when an item is toggled - more inner checks + test * drawer: fix when there isn't a page available * rollback cleaning up pinnedEntries on item-toggle * remove "re-setting" pinnedItems * remove the filter
This commit is contained in:
@@ -62,6 +62,18 @@ describe('inAppRewards', () => {
|
||||
expect(result[9].path).to.eql('potion');
|
||||
});
|
||||
|
||||
it('ignores null/undefined entries', () => {
|
||||
user.pinnedItems = testPinnedItems;
|
||||
user.pinnedItems.push(null);
|
||||
user.pinnedItems.push(undefined);
|
||||
user.pinnedItemsOrder = testPinnedItemsOrder;
|
||||
|
||||
let result = inAppRewards(user);
|
||||
|
||||
expect(result[2].path).to.eql('armoire');
|
||||
expect(result[9].path).to.eql('potion');
|
||||
});
|
||||
|
||||
it('does not return seasonal items which have been unpinned', () => {
|
||||
if (officialPinnedItems.length === 0) {
|
||||
return; // if no seasonal items, this test is not applicable
|
||||
|
||||
Reference in New Issue
Block a user