mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Common reorg (#8025)
* Re-organize common folder * fix: Correct paths in tests * fix: move new content to proper folder * chore: Move audio folder to assets * Move sprites to sprites assets directory * Move css sprites to assets directory * Split out readmes for common code and sprites * Move images to assets directory * Move destinatin of shared browserified file * remove unused file * move compiled js to client-old * Fix karma tests * fix: Correct paths for sprites
This commit is contained in:
committed by
Matteo Pagliazzi
parent
d971e673af
commit
81b7eeeb71
@@ -12,7 +12,8 @@ migrations/*
|
|||||||
website/client-old/
|
website/client-old/
|
||||||
|
|
||||||
# Temporarilly disabled. These should be removed when the linting errors are fixed
|
# Temporarilly disabled. These should be removed when the linting errors are fixed
|
||||||
common/script/content/index.js
|
website/common/script/content/index.js
|
||||||
|
website/common/browserify.js
|
||||||
|
|
||||||
debug-scripts/*
|
debug-scripts/*
|
||||||
scripts/*
|
scripts/*
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,8 +2,10 @@
|
|||||||
website/client-old/gen
|
website/client-old/gen
|
||||||
website/client-old/common
|
website/client-old/common
|
||||||
website/client-old/apidoc
|
website/client-old/apidoc
|
||||||
|
website/client-old/js/habitrpg-shared.js*
|
||||||
|
website/client-old/css/habitrpg-shared.css
|
||||||
website/transpiled-babel/
|
website/transpiled-babel/
|
||||||
common/transpiled-babel/
|
website/common/transpiled-babel/
|
||||||
node_modules
|
node_modules
|
||||||
*.swp
|
*.swp
|
||||||
.idea*
|
.idea*
|
||||||
@@ -30,7 +32,6 @@ website/client-old/docs
|
|||||||
coverage
|
coverage
|
||||||
coverage.html
|
coverage.html
|
||||||
common/dist/scripts/*
|
common/dist/scripts/*
|
||||||
common/dist/sprites/habitrpg-shared.css
|
|
||||||
|
|
||||||
test/spec/mocks/translations.js
|
test/spec/mocks/translations.js
|
||||||
|
|
||||||
|
|||||||
26
Gruntfile.js
26
Gruntfile.js
@@ -28,11 +28,11 @@ module.exports = function(grunt) {
|
|||||||
report: 'gzip'
|
report: 'gzip'
|
||||||
},
|
},
|
||||||
files:{
|
files:{
|
||||||
"common/dist/sprites/habitrpg-shared.css": [
|
"website/client-old/css/habitrpg-shared.css": [
|
||||||
"common/dist/sprites/spritesmith*.css",
|
"website/assets/sprites/dist/spritesmith*.css",
|
||||||
"common/css/backer.css",
|
"website/assets/sprites/css/backer.css",
|
||||||
"common/css/Mounts.css",
|
"website/assets/sprites/css/Mounts.css",
|
||||||
"common/css/index.css"
|
"website/assets/sprites/css/index.css"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,10 +57,10 @@ module.exports = function(grunt) {
|
|||||||
files: [
|
files: [
|
||||||
{expand: true, cwd: 'website/client-old/', src: 'favicon.ico', dest: 'website/build/'},
|
{expand: true, cwd: 'website/client-old/', src: 'favicon.ico', dest: 'website/build/'},
|
||||||
{expand: true, cwd: 'website/client-old/', src: 'favicon_192x192.png', dest: 'website/build/'},
|
{expand: true, cwd: 'website/client-old/', src: 'favicon_192x192.png', dest: 'website/build/'},
|
||||||
{expand: true, cwd: '', src: 'common/dist/sprites/spritesmith*.png', dest: 'website/build/'},
|
{expand: true, cwd: 'website/assets/sprites/dist/', src: 'spritesmith*.png', dest: 'website/build/'},
|
||||||
{expand: true, cwd: '', src: 'common/img/sprites/backer-only/*.gif', dest: 'website/build/'},
|
{expand: true, cwd: '', src: 'website/assets/sprites/backer-only/*.gif', dest: 'website/build/'},
|
||||||
{expand: true, cwd: '', src: 'common/img/sprites/npc_ian.gif', dest: 'website/build/'},
|
{expand: true, cwd: '', src: 'website/assets/sprites/npc_ian.gif', dest: 'website/build/'},
|
||||||
{expand: true, cwd: '', src: 'common/img/sprites/quest_*.gif', dest: 'website/build/'},
|
{expand: true, cwd: '', src: 'website/assets/sprites/quest_*.gif', dest: 'website/build/'},
|
||||||
{expand: true, cwd: 'website/client-old/', src: 'bower_components/bootstrap/dist/fonts/*', dest: 'website/build/'}
|
{expand: true, cwd: 'website/client-old/', src: 'bower_components/bootstrap/dist/fonts/*', dest: 'website/build/'}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -77,10 +77,10 @@ module.exports = function(grunt) {
|
|||||||
'website/build/*.css',
|
'website/build/*.css',
|
||||||
'website/build/favicon.ico',
|
'website/build/favicon.ico',
|
||||||
'website/build/favicon_192x192.png',
|
'website/build/favicon_192x192.png',
|
||||||
'website/build/common/dist/sprites/*.png',
|
'website/build/website/assets/sprites/dist/*.png',
|
||||||
'website/build/common/img/sprites/backer-only/*.gif',
|
'website/build/website/assets/sprites/backer-only/*.gif',
|
||||||
'website/build/common/img/sprites/npc_ian.gif',
|
'website/build/website/assets/sprites/npc_ian.gif',
|
||||||
'website/build/common/img/sprites/quest_*.gif',
|
'website/build/website/assets/sprites/quest_*.gif',
|
||||||
'website/build/bower_components/bootstrap/dist/fonts/*'
|
'website/build/bower_components/bootstrap/dist/fonts/*'
|
||||||
],
|
],
|
||||||
dest: 'website/build/*.css'
|
dest: 'website/build/*.css'
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "habitrpg/browser"
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Common
|
|
||||||
|
|
||||||
Shared resources useful for the multiple Habitica repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:
|
|
||||||
|
|
||||||
* Assets - sprites, images, etc
|
|
||||||
* CSS - especially, esp. sprite-sheet mapping
|
|
||||||
* Algorithms - level up algorithm, scoring functions, etc
|
|
||||||
* View helper functions that may come in handy for multiple client MVCs
|
|
||||||
* Item definitions - weapons, armor, pets
|
|
||||||
|
|
||||||
## Compiling spritesheets
|
|
||||||
Because of some wonkiness with Heroku, the spritesheet compilation is not part of the production build process and must be done manually when new images are added by running:
|
|
||||||
|
|
||||||
``` bash
|
|
||||||
npm run sprites
|
|
||||||
```
|
|
||||||
@@ -32,7 +32,7 @@ module.exports = function karmaConfig (config) {
|
|||||||
'website/client-old/bower_components/select2/select2.js',
|
'website/client-old/bower_components/select2/select2.js',
|
||||||
'website/client-old/bower_components/angular-ui-select2/src/select2.js',
|
'website/client-old/bower_components/angular-ui-select2/src/select2.js',
|
||||||
'website/client-old/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
|
'website/client-old/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
|
||||||
'common/dist/scripts/habitrpg-shared.js',
|
'website/client-old/js/habitrpg-shared.js',
|
||||||
|
|
||||||
'test/client-old/spec/mocks/**/*.js',
|
'test/client-old/spec/mocks/**/*.js',
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import babel from 'babelify';
|
|||||||
|
|
||||||
gulp.task('browserify', function () {
|
gulp.task('browserify', function () {
|
||||||
let bundler = browserify({
|
let bundler = browserify({
|
||||||
entries: './common/browserify.js',
|
entries: './website/common/browserify.js',
|
||||||
debug: true,
|
debug: true,
|
||||||
transform: [[babel, { compact: false }]],
|
transform: [[babel, { compact: false }]],
|
||||||
});
|
});
|
||||||
@@ -23,9 +23,9 @@ gulp.task('browserify', function () {
|
|||||||
this.emit('end');
|
this.emit('end');
|
||||||
})
|
})
|
||||||
.pipe(sourcemaps.write('./'))
|
.pipe(sourcemaps.write('./'))
|
||||||
.pipe(gulp.dest('./common/dist/scripts/'));
|
.pipe(gulp.dest('./website/client-old/js/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('browserify:watch', () => {
|
gulp.task('browserify:watch', () => {
|
||||||
gulp.watch('./common/script/**/*.js', ['browserify']);
|
gulp.watch('./website/common/script/**/*.js', ['browserify']);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ gulp.task('build:src', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:common', () => {
|
gulp.task('build:common', () => {
|
||||||
return gulp.src('common/script/**/*.js')
|
return gulp.src('website/common/script/**/*.js')
|
||||||
.pipe(babel())
|
.pipe(babel())
|
||||||
.pipe(gulp.dest('common/transpiled-babel/'));
|
.pipe(gulp.dest('website/common/transpiled-babel/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:server', ['build:src', 'build:common']);
|
gulp.task('build:server', ['build:src', 'build:common']);
|
||||||
@@ -30,7 +30,7 @@ gulp.task('build:dev', ['browserify', 'prepare:staticNewStuff'], (done) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:dev:watch', ['build:dev'], () => {
|
gulp.task('build:dev:watch', ['build:dev'], () => {
|
||||||
gulp.watch(['website/client-old/**/*.styl', 'common/script/*']);
|
gulp.watch(['website/client-old/**/*.styl', 'website/common/script/*']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:prod', ['browserify', 'build:server', 'prepare:staticNewStuff'], (done) => {
|
gulp.task('build:prod', ['browserify', 'build:server', 'prepare:staticNewStuff'], (done) => {
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ import {each} from 'lodash';
|
|||||||
|
|
||||||
// https://github.com/Ensighten/grunt-spritesmith/issues/67#issuecomment-34786248
|
// https://github.com/Ensighten/grunt-spritesmith/issues/67#issuecomment-34786248
|
||||||
const MAX_SPRITESHEET_SIZE = 1024 * 1024 * 3;
|
const MAX_SPRITESHEET_SIZE = 1024 * 1024 * 3;
|
||||||
const DIST_PATH = 'common/dist/sprites/';
|
const DIST_PATH = 'website/assets/sprites/dist/';
|
||||||
|
|
||||||
gulp.task('sprites:compile', ['sprites:clean', 'sprites:main', 'sprites:largeSprites', 'sprites:checkCompiledDimensions']);
|
gulp.task('sprites:compile', ['sprites:clean', 'sprites:main', 'sprites:largeSprites', 'sprites:checkCompiledDimensions']);
|
||||||
|
|
||||||
gulp.task('sprites:main', () => {
|
gulp.task('sprites:main', () => {
|
||||||
let mainSrc = sync('common/img/sprites/spritesmith/**/*.png');
|
let mainSrc = sync('website/assets/sprites/spritesmith/**/*.png');
|
||||||
return createSpritesStream('main', mainSrc);
|
return createSpritesStream('main', mainSrc);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('sprites:largeSprites', () => {
|
gulp.task('sprites:largeSprites', () => {
|
||||||
let largeSrc = sync('common/img/sprites/spritesmith_large/**/*.png');
|
let largeSrc = sync('website/assets/sprites/spritesmith_large/**/*.png');
|
||||||
return createSpritesStream('largeSprites', largeSrc);
|
return createSpritesStream('largeSprites', largeSrc);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ function createSpritesStream(name, src) {
|
|||||||
cssName: `spritesmith-${name}-${index}.css`,
|
cssName: `spritesmith-${name}-${index}.css`,
|
||||||
algorithm: 'binary-tree',
|
algorithm: 'binary-tree',
|
||||||
padding: 1,
|
padding: 1,
|
||||||
cssTemplate: 'common/css/css.template.handlebars',
|
cssTemplate: 'website/assets/sprites/css/css.template.handlebars',
|
||||||
cssVarMap: cssVarMap
|
cssVarMap: cssVarMap
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const SLACK_CONFIG = {
|
|||||||
emoji: 'transifex'
|
emoji: 'transifex'
|
||||||
}
|
}
|
||||||
|
|
||||||
const LOCALES = './common/locales/';
|
const LOCALES = './website/common/locales/';
|
||||||
const ENGLISH_LOCALE = `${LOCALES}en/`;
|
const ENGLISH_LOCALE = `${LOCALES}en/`;
|
||||||
const ALL_LANGUAGES = getArrayOfLanguages();
|
const ALL_LANGUAGES = getArrayOfLanguages();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
requester,
|
requester,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-v3-integration.helper';
|
} from '../../../../helpers/api-v3-integration.helper';
|
||||||
import i18n from '../../../../../common/script/i18n';
|
import i18n from '../../../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('GET /content', () => {
|
describe('GET /content', () => {
|
||||||
it('returns content (and does not require authentication)', async () => {
|
it('returns content (and does not require authentication)', async () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-v3-integration.helper';
|
} from '../../../../helpers/api-v3-integration.helper';
|
||||||
import { v4 as generateUUID } from 'uuid';
|
import { v4 as generateUUID } from 'uuid';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
|
|
||||||
describe('GET /groups/:groupId/members', () => {
|
describe('GET /groups/:groupId/members', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-v3-integration.helper';
|
} from '../../../../helpers/api-v3-integration.helper';
|
||||||
import { v4 as generateUUID } from 'uuid';
|
import { v4 as generateUUID } from 'uuid';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
|
|
||||||
describe('GET /members/:memberId', () => {
|
describe('GET /members/:memberId', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
sleep,
|
sleep,
|
||||||
} from '../../../../helpers/api-v3-integration.helper';
|
} from '../../../../helpers/api-v3-integration.helper';
|
||||||
import { v4 as generateUUID } from 'uuid';
|
import { v4 as generateUUID } from 'uuid';
|
||||||
import { quests as questScrolls } from '../../../../../common/script/content';
|
import { quests as questScrolls } from '../../../../../website/common/script/content';
|
||||||
|
|
||||||
describe('POST /groups/:groupId/quests/invite/:questKey', () => {
|
describe('POST /groups/:groupId/quests/invite/:questKey', () => {
|
||||||
let questingGroup;
|
let questingGroup;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
|
|
||||||
describe('GET /user', () => {
|
describe('GET /user', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
generateDaily,
|
generateDaily,
|
||||||
generateReward,
|
generateReward,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
import { v4 as generateUUID } from 'uuid';
|
import { v4 as generateUUID } from 'uuid';
|
||||||
|
|
||||||
describe('GET /user/anonymized', () => {
|
describe('GET /user/anonymized', () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import shared from '../../../../../common/script';
|
import shared from '../../../../../website/common/script';
|
||||||
|
|
||||||
let content = shared.content;
|
let content = shared.content;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import shared from '../../../../../common/script';
|
import shared from '../../../../../website/common/script';
|
||||||
|
|
||||||
let content = shared.content;
|
let content = shared.content;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import shared from '../../../../../common/script';
|
import shared from '../../../../../website/common/script';
|
||||||
|
|
||||||
let content = shared.content;
|
let content = shared.content;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import shared from '../../../../../common/script';
|
import shared from '../../../../../website/common/script';
|
||||||
|
|
||||||
let content = shared.content;
|
let content = shared.content;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import content from '../../../../../common/script/content';
|
import content from '../../../../../website/common/script/content';
|
||||||
|
|
||||||
describe('POST /user/feed/:pet/:food', () => {
|
describe('POST /user/feed/:pet/:food', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import content from '../../../../../common/script/content/index';
|
import content from '../../../../../website/common/script/content/index';
|
||||||
|
|
||||||
describe('POST /user/open-mystery-item', () => {
|
describe('POST /user/open-mystery-item', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
translate as t,
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
import content from '../../../../../common/script/content';
|
import content from '../../../../../website/common/script/content';
|
||||||
|
|
||||||
describe('POST /user/sell/:type/:key', () => {
|
describe('POST /user/sell/:type/:key', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { recoverCron, cron } from '../../../../../website/server/libs/cron';
|
|||||||
import { model as User } from '../../../../../website/server/models/user';
|
import { model as User } from '../../../../../website/server/models/user';
|
||||||
import * as Tasks from '../../../../../website/server/models/task';
|
import * as Tasks from '../../../../../website/server/models/task';
|
||||||
import { clone } from 'lodash';
|
import { clone } from 'lodash';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
|
|
||||||
// const scoreTask = common.ops.scoreTask;
|
// const scoreTask = common.ops.scoreTask;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
getTasks,
|
getTasks,
|
||||||
syncableAttrs,
|
syncableAttrs,
|
||||||
} from '../../../../../website/server/libs/taskManager';
|
} from '../../../../../website/server/libs/taskManager';
|
||||||
import i18n from '../../../../../common/script/i18n';
|
import i18n from '../../../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateGroup,
|
generateGroup,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
generateReq,
|
generateReq,
|
||||||
generateNext,
|
generateNext,
|
||||||
} from '../../../../helpers/api-unit.helper';
|
} from '../../../../helpers/api-unit.helper';
|
||||||
import i18n from '../../../../../common/script/i18n';
|
import i18n from '../../../../../website/common/script/i18n';
|
||||||
import { ensureAdmin, ensureSudo } from '../../../../../website/server/middlewares/ensureAccessRight';
|
import { ensureAdmin, ensureSudo } from '../../../../../website/server/middlewares/ensureAccessRight';
|
||||||
import { NotAuthorized } from '../../../../../website/server/libs/errors';
|
import { NotAuthorized } from '../../../../../website/server/libs/errors';
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
getUserLanguage,
|
getUserLanguage,
|
||||||
attachTranslateFunction,
|
attachTranslateFunction,
|
||||||
} from '../../../../../website/server/middlewares/language';
|
} from '../../../../../website/server/middlewares/language';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
import Bluebird from 'bluebird';
|
import Bluebird from 'bluebird';
|
||||||
import { model as User } from '../../../../../website/server/models/user';
|
import { model as User } from '../../../../../website/server/models/user';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { model as Challenge } from '../../../../../website/server/models/challen
|
|||||||
import { model as Group } from '../../../../../website/server/models/group';
|
import { model as Group } from '../../../../../website/server/models/group';
|
||||||
import { model as User } from '../../../../../website/server/models/user';
|
import { model as User } from '../../../../../website/server/models/user';
|
||||||
import * as Tasks from '../../../../../website/server/models/task';
|
import * as Tasks from '../../../../../website/server/models/task';
|
||||||
import common from '../../../../../common/';
|
import common from '../../../../../website/common/';
|
||||||
import { each, find } from 'lodash';
|
import { each, find } from 'lodash';
|
||||||
|
|
||||||
describe('Challenge Model', () => {
|
describe('Challenge Model', () => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { sleep } from '../../../../helpers/api-unit.helper';
|
import { sleep } from '../../../../helpers/api-unit.helper';
|
||||||
import { model as Group } from '../../../../../website/server/models/group';
|
import { model as Group } from '../../../../../website/server/models/group';
|
||||||
import { model as User } from '../../../../../website/server/models/user';
|
import { model as User } from '../../../../../website/server/models/user';
|
||||||
import { quests as questScrolls } from '../../../../../common/script/content';
|
import { quests as questScrolls } from '../../../../../website/common/script/content';
|
||||||
import * as email from '../../../../../website/server/libs/email';
|
import * as email from '../../../../../website/server/libs/email';
|
||||||
import validator from 'validator';
|
import validator from 'validator';
|
||||||
import { TAVERN_ID } from '../../../../../common/script/';
|
import { TAVERN_ID } from '../../../../../website/common/script/';
|
||||||
|
|
||||||
describe('Group Model', () => {
|
describe('Group Model', () => {
|
||||||
let party, questLeader, participatingMember, nonParticipatingMember, undecidedMember;
|
let party, questLeader, participatingMember, nonParticipatingMember, undecidedMember;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { model as User } from '../../../../../website/server/models/user';
|
import { model as User } from '../../../../../website/server/models/user';
|
||||||
import common from '../../../../../common';
|
import common from '../../../../../website/common';
|
||||||
|
|
||||||
describe('User Model', () => {
|
describe('User Model', () => {
|
||||||
it('keeps user._tmp when calling .toJSON', () => {
|
it('keeps user._tmp when calling .toJSON', () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
let count = require('../../common/script/count');
|
let count = require('../../website/common/script/count');
|
||||||
|
|
||||||
describe('count', () => {
|
describe('count', () => {
|
||||||
describe('beastMasterProgress', () => {
|
describe('beastMasterProgress', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import autoAllocate from '../../../common/script/fns/autoAllocate';
|
import autoAllocate from '../../../website/common/script/fns/autoAllocate';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import crit from '../../../common/script/fns/crit';
|
import crit from '../../../website/common/script/fns/crit';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import handleTwoHanded from '../../../common/script/fns/handleTwoHanded';
|
import handleTwoHanded from '../../../website/common/script/fns/handleTwoHanded';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import predictableRandom from '../../../common/script/fns/predictableRandom';
|
import predictableRandom from '../../../website/common/script/fns/predictableRandom';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import randomDrop from '../../../common/script/fns/randomDrop';
|
import randomDrop from '../../../website/common/script/fns/randomDrop';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateTodo,
|
generateTodo,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import randomVal from '../../../common/script/fns/randomVal';
|
import randomVal from '../../../website/common/script/fns/randomVal';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import statsComputed from '../../../common/script/libs/statsComputed';
|
import statsComputed from '../../../website/common/script/libs/statsComputed';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import ultimateGear from '../../../common/script/fns/ultimateGear';
|
import ultimateGear from '../../../website/common/script/fns/ultimateGear';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import updateStats from '../../../common/script/fns/updateStats';
|
import updateStats from '../../../website/common/script/fns/updateStats';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import appliedTags from '../../../common/script/libs/appliedTags';
|
import appliedTags from '../../../website/common/script/libs/appliedTags';
|
||||||
|
|
||||||
describe('appliedTags', () => {
|
describe('appliedTags', () => {
|
||||||
it('returns the tasks', () => {
|
it('returns the tasks', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import gold from '../../../common/script/libs/gold';
|
import gold from '../../../website/common/script/libs/gold';
|
||||||
|
|
||||||
describe('gold', () => {
|
describe('gold', () => {
|
||||||
it('is 0', () => {
|
it('is 0', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import noTags from '../../../common/script/libs/noTags';
|
import noTags from '../../../website/common/script/libs/noTags';
|
||||||
|
|
||||||
describe('noTags', () => {
|
describe('noTags', () => {
|
||||||
it('returns true for no tags', () => {
|
it('returns true for no tags', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import percent from '../../../common/script/libs/percent';
|
import percent from '../../../website/common/script/libs/percent';
|
||||||
|
|
||||||
describe('percent', () => {
|
describe('percent', () => {
|
||||||
it('with direction "up"', () => {
|
it('with direction "up"', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import pickDeep from '../../../common/script/libs/pickDeep';
|
import pickDeep from '../../../website/common/script/libs/pickDeep';
|
||||||
|
|
||||||
describe('pickDeep', () => {
|
describe('pickDeep', () => {
|
||||||
it('throws an error if "properties" is not an array', () => {
|
it('throws an error if "properties" is not an array', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import shared from '../../../common';
|
import shared from '../../../website/common';
|
||||||
import { v4 as generateUUID } from 'uuid';
|
import { v4 as generateUUID } from 'uuid';
|
||||||
|
|
||||||
describe('refPush', () => {
|
describe('refPush', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import shared from '../../../common';
|
import shared from '../../../website/common';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import silver from '../../../common/script/libs/silver';
|
import silver from '../../../website/common/script/libs/silver';
|
||||||
|
|
||||||
describe('silver', () => {
|
describe('silver', () => {
|
||||||
it('is 0', () => {
|
it('is 0', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import splitWhitespace from '../../../common/script/libs/splitWhitespace';
|
import splitWhitespace from '../../../website/common/script/libs/splitWhitespace';
|
||||||
|
|
||||||
describe('splitWhitespace', () => {
|
describe('splitWhitespace', () => {
|
||||||
it('returns an array', () => {
|
it('returns an array', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import taskClasses from '../../../common/script/libs/taskClasses';
|
import taskClasses from '../../../website/common/script/libs/taskClasses';
|
||||||
|
|
||||||
describe('taskClasses', () => {
|
describe('taskClasses', () => {
|
||||||
let task = {};
|
let task = {};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import taskDefaults from '../../../common/script/libs/taskDefaults';
|
import taskDefaults from '../../../website/common/script/libs/taskDefaults';
|
||||||
|
|
||||||
describe('taskDefaults', () => {
|
describe('taskDefaults', () => {
|
||||||
it('applies defaults to undefined type or habit', () => {
|
it('applies defaults to undefined type or habit', () => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import shared from '../../../common';
|
import shared from '../../../website/common';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('updateStore', () => {
|
describe('updateStore', () => {
|
||||||
context('returns a list of gear items available for purchase', () => {
|
context('returns a list of gear items available for purchase', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import addTask from '../../../common/script/ops/addTask';
|
import addTask from '../../../website/common/script/ops/addTask';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import addWebhook from '../../../common/script/ops/addWebhook';
|
import addWebhook from '../../../website/common/script/ops/addWebhook';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import allocate from '../../../common/script/ops/allocate';
|
import allocate from '../../../website/common/script/ops/allocate';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import allocateNow from '../../../common/script/ops/allocateNow';
|
import allocateNow from '../../../website/common/script/ops/allocateNow';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import blockUser from '../../../common/script/ops/blockUser';
|
import blockUser from '../../../website/common/script/ops/blockUser';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.blockUser', () => {
|
describe('shared.ops.blockUser', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import buy from '../../../common/script/ops/buy';
|
import buy from '../../../website/common/script/ops/buy';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buy', () => {
|
describe('shared.ops.buy', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import sinon from 'sinon'; // eslint-disable-line no-shadow
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import count from '../../../common/script/count';
|
import count from '../../../website/common/script/count';
|
||||||
import buyArmoire from '../../../common/script/ops/buyArmoire';
|
import buyArmoire from '../../../website/common/script/ops/buyArmoire';
|
||||||
import shared from '../../../common/script';
|
import shared from '../../../website/common/script';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buyArmoire', () => {
|
describe('shared.ops.buyArmoire', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import sinon from 'sinon'; // eslint-disable-line no-shadow
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import buyGear from '../../../common/script/ops/buyGear';
|
import buyGear from '../../../website/common/script/ops/buyGear';
|
||||||
import shared from '../../../common/script';
|
import shared from '../../../website/common/script';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buyGear', () => {
|
describe('shared.ops.buyGear', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import buyHealthPotion from '../../../common/script/ops/buyHealthPotion';
|
import buyHealthPotion from '../../../website/common/script/ops/buyHealthPotion';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buyHealthPotion', () => {
|
describe('shared.ops.buyHealthPotion', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import buyMysterySet from '../../../common/script/ops/buyMysterySet';
|
import buyMysterySet from '../../../website/common/script/ops/buyMysterySet';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buyMysterySet', () => {
|
describe('shared.ops.buyMysterySet', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import buyQuest from '../../../common/script/ops/buyQuest';
|
import buyQuest from '../../../website/common/script/ops/buyQuest';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.buyQuest', () => {
|
describe('shared.ops.buyQuest', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import buySpecialSpell from '../../../common/script/ops/buySpecialSpell';
|
import buySpecialSpell from '../../../website/common/script/ops/buySpecialSpell';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotFound,
|
NotFound,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
|
|
||||||
describe('shared.ops.buySpecialSpell', () => {
|
describe('shared.ops.buySpecialSpell', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import changeClass from '../../../common/script/ops/changeClass';
|
import changeClass from '../../../website/common/script/ops/changeClass';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import clearPMs from '../../../common/script/ops/clearPMs';
|
import clearPMs from '../../../website/common/script/ops/clearPMs';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import deletePM from '../../../common/script/ops/deletePM';
|
import deletePM from '../../../website/common/script/ops/deletePM';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import deleteWebhook from '../../../common/script/ops/deleteWebhook';
|
import deleteWebhook from '../../../website/common/script/ops/deleteWebhook';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import disableClasses from '../../../common/script/ops/disableClasses';
|
import disableClasses from '../../../website/common/script/ops/disableClasses';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import equip from '../../../common/script/ops/equip';
|
import equip from '../../../website/common/script/ops/equip';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
|
|
||||||
describe('shared.ops.equip', () => {
|
describe('shared.ops.equip', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import feed from '../../../common/script/ops/feed';
|
import feed from '../../../website/common/script/ops/feed';
|
||||||
import content from '../../../common/script/content';
|
import content from '../../../website/common/script/content';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import hatch from '../../../common/script/ops/hatch';
|
import hatch from '../../../website/common/script/ops/hatch';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import hourglassPurchase from '../../../common/script/ops/hourglassPurchase';
|
import hourglassPurchase from '../../../website/common/script/ops/hourglassPurchase';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import openMysteryItem from '../../../common/script/ops/openMysteryItem';
|
import openMysteryItem from '../../../website/common/script/ops/openMysteryItem';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
|
|
||||||
describe('shared.ops.openMysteryItem', () => {
|
describe('shared.ops.openMysteryItem', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import purchase from '../../../common/script/ops/purchase';
|
import purchase from '../../../website/common/script/ops/purchase';
|
||||||
import planGemLimits from '../../../common/script/libs/planGemLimits';
|
import planGemLimits from '../../../website/common/script/libs/planGemLimits';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import readCard from '../../../common/script/ops/readCard';
|
import readCard from '../../../website/common/script/ops/readCard';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.readCard', () => {
|
describe('shared.ops.readCard', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import rebirth from '../../../common/script/ops/rebirth';
|
import rebirth from '../../../website/common/script/ops/rebirth';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import { MAX_LEVEL } from '../../../common/script/constants';
|
import { MAX_LEVEL } from '../../../website/common/script/constants';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateHabit,
|
generateHabit,
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.rebirth', () => {
|
describe('shared.ops.rebirth', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import releaseBoth from '../../../common/script/ops/releaseBoth';
|
import releaseBoth from '../../../website/common/script/ops/releaseBoth';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.releaseBoth', () => {
|
describe('shared.ops.releaseBoth', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import releaseMounts from '../../../common/script/ops/releaseMounts';
|
import releaseMounts from '../../../website/common/script/ops/releaseMounts';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.releaseMounts', () => {
|
describe('shared.ops.releaseMounts', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import releasePets from '../../../common/script/ops/releasePets';
|
import releasePets from '../../../website/common/script/ops/releasePets';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.releasePets', () => {
|
describe('shared.ops.releasePets', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import reroll from '../../../common/script/ops/reroll';
|
import reroll from '../../../website/common/script/ops/reroll';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateDaily,
|
generateDaily,
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.reroll', () => {
|
describe('shared.ops.reroll', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import reset from '../../../common/script/ops/reset';
|
import reset from '../../../website/common/script/ops/reset';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateDaily,
|
generateDaily,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import revive from '../../../common/script/ops/revive';
|
import revive from '../../../website/common/script/ops/revive';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
|
|
||||||
describe('shared.ops.revive', () => {
|
describe('shared.ops.revive', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import scoreTask from '../../../common/script/ops/scoreTask';
|
import scoreTask from '../../../website/common/script/ops/scoreTask';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
generateDaily,
|
generateDaily,
|
||||||
@@ -6,11 +6,11 @@ import {
|
|||||||
generateTodo,
|
generateTodo,
|
||||||
generateReward,
|
generateReward,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import common from '../../../common';
|
import common from '../../../website/common';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
let EPSILON = 0.0001; // negligible distance between datapoints
|
let EPSILON = 0.0001; // negligible distance between datapoints
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import sell from '../../../common/script/ops/sell';
|
import sell from '../../../website/common/script/ops/sell';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
BadRequest,
|
BadRequest,
|
||||||
NotFound,
|
NotFound,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import content from '../../../common/script/content/index';
|
import content from '../../../website/common/script/content/index';
|
||||||
|
|
||||||
describe('shared.ops.sell', () => {
|
describe('shared.ops.sell', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import sleep from '../../../common/script/ops/sleep';
|
import sleep from '../../../website/common/script/ops/sleep';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import unlock from '../../../common/script/ops/unlock';
|
import unlock from '../../../website/common/script/ops/unlock';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
import {
|
import {
|
||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
BadRequest,
|
BadRequest,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
|
|
||||||
describe('shared.ops.unlock', () => {
|
describe('shared.ops.unlock', () => {
|
||||||
let user;
|
let user;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import updateTask from '../../../common/script/ops/updateTask';
|
import updateTask from '../../../website/common/script/ops/updateTask';
|
||||||
import {
|
import {
|
||||||
generateHabit,
|
generateHabit,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import updateWebhook from '../../../common/script/ops/updateWebhook';
|
import updateWebhook from '../../../website/common/script/ops/updateWebhook';
|
||||||
import {
|
import {
|
||||||
BadRequest,
|
BadRequest,
|
||||||
} from '../../../common/script/libs/errors';
|
} from '../../../website/common/script/libs/errors';
|
||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
} from '../../helpers/common.helper';
|
} from '../../helpers/common.helper';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
capByLevel,
|
capByLevel,
|
||||||
tnl,
|
tnl,
|
||||||
diminishingReturns,
|
diminishingReturns,
|
||||||
} from '../../common/script/index';
|
} from '../../website/common/script/index';
|
||||||
|
|
||||||
describe('helper functions used in stat calculations', () => {
|
describe('helper functions used in stat calculations', () => {
|
||||||
describe('maxHealth', () => {
|
describe('maxHealth', () => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
expectValidTranslationString,
|
expectValidTranslationString,
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
|
|
||||||
import eggs from '../../common/script/content/eggs';
|
import eggs from '../../website/common/script/content/eggs';
|
||||||
|
|
||||||
describe('eggs', () => {
|
describe('eggs', () => {
|
||||||
describe('all', () => {
|
describe('all', () => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
expectValidTranslationString,
|
expectValidTranslationString,
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
|
|
||||||
import {questions, stillNeedHelp} from '../../common/script/content/faq';
|
import {questions, stillNeedHelp} from '../../website/common/script/content/faq';
|
||||||
|
|
||||||
describe('FAQ Locales', () => {
|
describe('FAQ Locales', () => {
|
||||||
describe('Questions', () => {
|
describe('Questions', () => {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import {
|
|||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
import { each, camelCase } from 'lodash';
|
import { each, camelCase } from 'lodash';
|
||||||
|
|
||||||
import { tree as allGear } from '../../common/script/content/gear';
|
import { tree as allGear } from '../../website/common/script/content/gear';
|
||||||
import backerGear from '../../common/script/content/gear/sets/special/special-backer';
|
import backerGear from '../../website/common/script/content/gear/sets/special/special-backer';
|
||||||
import contributorGear from '../../common/script/content/gear/sets/special/special-contributor';
|
import contributorGear from '../../website/common/script/content/gear/sets/special/special-contributor';
|
||||||
|
|
||||||
describe('Gear', () => {
|
describe('Gear', () => {
|
||||||
each(allGear, (piece, gearType) => {
|
each(allGear, (piece, gearType) => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
expectValidTranslationString,
|
expectValidTranslationString,
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
|
|
||||||
import hatchingPotions from '../../common/script/content/hatching-potions';
|
import hatchingPotions from '../../website/common/script/content/hatching-potions';
|
||||||
|
|
||||||
describe('hatchingPotions', () => {
|
describe('hatchingPotions', () => {
|
||||||
describe('all', () => {
|
describe('all', () => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
expectValidTranslationString
|
expectValidTranslationString
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
|
|
||||||
import mysterySets from '../../common/script/content/mystery-sets';
|
import mysterySets from '../../website/common/script/content/mystery-sets';
|
||||||
|
|
||||||
describe('Mystery Sets', () => {
|
describe('Mystery Sets', () => {
|
||||||
it('has a valid text string', () => {
|
it('has a valid text string', () => {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import {
|
|||||||
import {
|
import {
|
||||||
expectValidTranslationString,
|
expectValidTranslationString,
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
import t from '../../common/script/content/translation';
|
import t from '../../website/common/script/content/translation';
|
||||||
|
|
||||||
import stable from '../../common/script/content/stable';
|
import stable from '../../website/common/script/content/stable';
|
||||||
import eggs from '../../common/script/content/eggs';
|
import eggs from '../../website/common/script/content/eggs';
|
||||||
import potions from '../../common/script/content/hatching-potions';
|
import potions from '../../website/common/script/content/hatching-potions';
|
||||||
|
|
||||||
describe('stable', () => {
|
describe('stable', () => {
|
||||||
describe('dropPets', () => {
|
describe('dropPets', () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {STRING_ERROR_MSG, STRING_DOES_NOT_EXIST_MSG} from '../helpers/content.helper';
|
import {STRING_ERROR_MSG, STRING_DOES_NOT_EXIST_MSG} from '../helpers/content.helper';
|
||||||
import translator from '../../common/script/content/translation';
|
import translator from '../../website/common/script/content/translation';
|
||||||
|
|
||||||
describe('Translator', () => {
|
describe('Translator', () => {
|
||||||
it('returns error message if string is not properly formatted', () => {
|
it('returns error message if string is not properly formatted', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import i18n from '../../../common/script/i18n';
|
import i18n from '../../../website/common/script/i18n';
|
||||||
i18n.translations = require('../../../website/server/libs/i18n').translations;
|
i18n.translations = require('../../../website/server/libs/i18n').translations;
|
||||||
|
|
||||||
// Use this to verify error messages returned by the server
|
// Use this to verify error messages returned by the server
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { model as Group } from '../../website/server/models/group';
|
|||||||
import { model as Challenge } from '../../website/server/models/challenge';
|
import { model as Challenge } from '../../website/server/models/challenge';
|
||||||
import mongo from './mongo'; // eslint-disable-line
|
import mongo from './mongo'; // eslint-disable-line
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import i18n from '../../common/script/i18n';
|
import i18n from '../../website/common/script/i18n';
|
||||||
import * as Tasks from '../../website/server/models/task';
|
import * as Tasks from '../../website/server/models/task';
|
||||||
|
|
||||||
afterEach((done) => {
|
afterEach((done) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
|
|
||||||
import { wrap as wrapUser } from '../../common/script/index';
|
import { wrap as wrapUser } from '../../website/common/script/index';
|
||||||
import { model as User } from '../../website/server/models/user';
|
import { model as User } from '../../website/server/models/user';
|
||||||
import {
|
import {
|
||||||
DailySchema,
|
DailySchema,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user