mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
make it easier to unequip backgrounds
This commit is contained in:
parent
42cafbeaab
commit
36b589e92d
2 changed files with 9 additions and 0 deletions
|
|
@ -274,6 +274,14 @@ describe('PUT /user', () => {
|
|||
expect(get(updatedUser.preferences, type)).to.eql(item);
|
||||
});
|
||||
});
|
||||
|
||||
it('updates user when background is unequipped', async () => {
|
||||
expect(get(user.preferences, 'background')).to.not.eql('');
|
||||
|
||||
const updatedUser = await user.put('/user', { 'preferences.background': '' });
|
||||
|
||||
expect(get(updatedUser.preferences, 'background')).to.eql('');
|
||||
});
|
||||
});
|
||||
|
||||
context('Improvement Categories', () => {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ const requiresPurchase = {
|
|||
};
|
||||
|
||||
function checkPreferencePurchase (user, path, item) {
|
||||
if (path === 'background' && item === '') return true;
|
||||
const itemPath = `${path}.${item}`;
|
||||
const appearance = _.get(common.content.appearances, itemPath);
|
||||
if (!appearance) return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue