mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
simplify tests and add console.log for debugging
This commit is contained in:
@@ -20,7 +20,9 @@ angular.module('habitrpg')
|
|||||||
|
|
||||||
// Something has changed on the user object that was not tracked here, sync the user
|
// Something has changed on the user object that was not tracked here, sync the user
|
||||||
if (isNotSync && ($rootScope.User.user._v - oldUserV) > 1) {
|
if (isNotSync && ($rootScope.User.user._v - oldUserV) > 1) {
|
||||||
|
console.log('before sync', Date.now())
|
||||||
$rootScope.User.sync();
|
$rootScope.User.sync();
|
||||||
|
console.log('after sync', Date.now())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ describe('cron middleware', () => {
|
|||||||
|
|
||||||
it('calls next when user is not attached', (done) => {
|
it('calls next when user is not attached', (done) => {
|
||||||
res.locals.user = null;
|
res.locals.user = null;
|
||||||
cronMiddleware(req, res, (err) => done(err));
|
cronMiddleware(req, res, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('calls next when days have not been missed', (done) => {
|
it('calls next when days have not been missed', (done) => {
|
||||||
cronMiddleware(req, res, (err) => done(err));
|
cronMiddleware(req, res, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should clear todos older than 30 days for free users', async (done) => {
|
it('should clear todos older than 30 days for free users', async (done) => {
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ angular.module('habitrpg')
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (response.data.message) Notification.text(response.data.message);
|
if (response.data.message) Notification.text(response.data.message);
|
||||||
|
|
||||||
|
console.log('before extend', Date.now())
|
||||||
_.extend(user, response.data.data);
|
_.extend(user, response.data.data);
|
||||||
|
console.log('after extend', Date.now())
|
||||||
|
|
||||||
$rootScope.$emit('userUpdated', user);
|
$rootScope.$emit('userUpdated', user);
|
||||||
|
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ api.transferGems = {
|
|||||||
receiverName: receiver.profile.name,
|
receiverName: receiver.profile.name,
|
||||||
senderName: sender.profile.name,
|
senderName: sender.profile.name,
|
||||||
});
|
});
|
||||||
message += res.t('privateMessageGiftGemsMessage', {gemAmount});
|
message += ` ${res.t('privateMessageGiftGemsMessage', {gemAmount})}`;
|
||||||
|
|
||||||
if (req.body.message) {
|
if (req.body.message) {
|
||||||
message += req.body.message;
|
message += req.body.message;
|
||||||
|
|||||||
Reference in New Issue
Block a user