make it easier to unequip backgrounds
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user