WIP: Improve User model performances (#10832)

* wip: define items as mixed objects

* add default owned gear

* mark modified

* more mark modified

* more mark modified

* more mark modified

* more mark modified

* fix common tests

* fix common tests

* update mongoose

* add itemsUtils

* use new util function in hall controller

* add tests for items utils

* update website/server to mark all items as modified

* start updating common code

* update login incentives

* update unlock

* remove changes to package-lock.json

* remove changes to package.json
This commit is contained in:
Matteo Pagliazzi
2019-04-01 19:24:18 +02:00
committed by GitHub
parent 95e541ae75
commit 0b8ce63c76
38 changed files with 304 additions and 42 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ import {
import i18n from '../../../../website/common/script/i18n';
import content from '../../../../website/common/script/content/index';
import errorMessage from '../../../../website/common/script/libs/errorMessage';
import { defaultsDeep } from 'lodash';
describe('shared.ops.buy', () => {
let user;
@@ -16,6 +17,10 @@ describe('shared.ops.buy', () => {
beforeEach(() => {
user = generateUser({
stats: { gp: 200 },
});
defaultsDeep(user, {
items: {
gear: {
owned: {
@@ -26,7 +31,6 @@ describe('shared.ops.buy', () => {
},
},
},
stats: { gp: 200 },
});
sinon.stub(analytics, 'track');
+5 -1
View File
@@ -11,6 +11,7 @@ import {
} from '../../../../website/common/script/libs/errors';
import i18n from '../../../../website/common/script/i18n';
import errorMessage from '../../../../website/common/script/libs/errorMessage';
import { defaultsDeep } from 'lodash';
function buyGear (user, req, analytics) {
let buyOp = new BuyMarketGearOperation(user, req, analytics);
@@ -24,6 +25,10 @@ describe('shared.ops.buyMarketGear', () => {
beforeEach(() => {
user = generateUser({
stats: { gp: 200 },
});
defaultsDeep(user, {
items: {
gear: {
owned: {
@@ -34,7 +39,6 @@ describe('shared.ops.buyMarketGear', () => {
},
},
},
stats: { gp: 200 },
});
sinon.stub(shared, 'randomVal');