Fixes #7958 - do not remove Battle Gear equipment when changing class (#8064)

* Changed files to fix Bug 7958:
 - website/client-old/.../userCtrl.js#38: removed to keep inventory constant
 - website/common/.../changeClass.js#33:  removed to stop 'classes' introduction

* Adjustments following Bug Review
 - Removed remaining 'foundKey' logic
 - Adjusted test logic to reflect feature change

* Reverting userCtrl.js to development version
 - Reintroduces "classes" Guide tour

* New version of Fixes #7958
 - Changed logic to only notify user the first time they choose a class
 - Changed message to represent this change in logic
 - #LINT: Cleaned interface for changing class
    - New method: enableClasses() -- because, really, should we be calling User.changeClass({}) from the UX?
    - New method: payForNewClass() -- handles prompting the user to confirm that they want to change class

* Remove new User Flag, use flags.tour.classes

* Whoopsie. Fix PR conflict.

* Changed files to fix Bug 7958:
 - website/client-old/.../userCtrl.js#38: removed to keep inventory constant
 - website/common/.../changeClass.js#33:  removed to stop 'classes' introduction

* Adjustments following Bug Review
 - Removed remaining 'foundKey' logic
 - Adjusted test logic to reflect feature change

* Reverting userCtrl.js to development version
 - Reintroduces "classes" Guide tour

* New version of Fixes #7958
 - Changed logic to only notify user the first time they choose a class
 - Changed message to represent this change in logic
 - #LINT: Cleaned interface for changing class
    - New method: enableClasses() -- because, really, should we be calling User.changeClass({}) from the UX?
    - New method: payForNewClass() -- handles prompting the user to confirm that they want to change class

* Remove new User Flag, use flags.tour.classes

* Whoopsie. Fix PR conflict.

* Removed Extraneous Flag

* Removed Extraneous Flag

* Changed files to fix Bug 7958:
 - website/client-old/.../userCtrl.js#38: removed to keep inventory constant
 - website/common/.../changeClass.js#33:  removed to stop 'classes' introduction

* New version of Fixes #7958
 - Changed logic to only notify user the first time they choose a class
 - Changed message to represent this change in logic
 - #LINT: Cleaned interface for changing class
    - New method: enableClasses() -- because, really, should we be calling User.changeClass({}) from the UX?
    - New method: payForNewClass() -- handles prompting the user to confirm that they want to change class

Remove new User Flag, use flags.tour.classes

Whoopsie. Fix PR conflict.

Removed Extraneous Flag

* Fixes handling architecture change

* Updates following Review 20170418-0602

* Remove cause of mocha/no-exclusive-tests lint failure
This commit is contained in:
CJ
2017-07-20 13:28:53 -04:00
committed by Sabe Jones
parent ca90d88289
commit 605391e4e7
7 changed files with 29 additions and 47 deletions

View File

@@ -1,3 +1,5 @@
/* eslint-disable camelcase */
import changeClass from '../../../website/common/script/ops/changeClass';
import {
NotAuthorized,
@@ -58,7 +60,8 @@ describe('shared.ops.changeClass', () => {
it('changes class', () => {
user.stats.class = 'healer';
user.items.gear.owned.armor_rogue_1 = true; // eslint-disable-line camelcase
user.items.gear.owned.weapon_healer_3 = true;
user.items.gear.equipped.weapon = 'weapon_healer_3';
let [data] = changeClass(user, {query: {class: 'rogue'}});
expect(data).to.eql({
@@ -70,13 +73,10 @@ describe('shared.ops.changeClass', () => {
expect(user.stats.class).to.equal('rogue');
expect(user.flags.classSelected).to.be.true;
expect(user.items.gear.equipped.weapon).to.equal('weapon_rogue_0');
expect(user.items.gear.owned.weapon_rogue_0).to.be.true;
expect(user.items.gear.equipped.armor).to.equal('armor_rogue_1');
expect(user.items.gear.owned.armor_rogue_1).to.be.true;
expect(user.items.gear.equipped.shield).to.equal('shield_rogue_0');
expect(user.items.gear.owned.shield_rogue_0).to.be.true;
expect(user.items.gear.equipped.head).to.equal('head_base_0');
expect(user.items.gear.owned.weapon_healer_3).to.be.true;
expect(user.items.gear.equipped.weapon).to.equal('weapon_healer_3');
});
});