Skip to content

Commit 568ba5d

Browse files
Merge branch 'develop' into 'master'
Release 2.0: Develop To Master See merge request noluckjustskill/hackathon_training!89
2 parents 96ffc24 + bd77e14 commit 568ba5d

File tree

100 files changed

+20473
-7342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+20473
-7342
lines changed

.eslintrc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module.exports = {
22
root: true,
33
env: {
44
browser: true,
5-
node: true
5+
node: true,
6+
jest: true,
67
},
78
parserOptions: {
89
ecmaVersion: 8
@@ -15,7 +16,11 @@ module.exports = {
1516
// 'plugin:nuxt/recommended'
1617
'plugin:vue/recommended'
1718
],
19+
globals: {
20+
logger: 'readonly',
21+
},
1822
rules: {
23+
'eqeqeq': ["error"],
1924
'max-len': ['error', 160, {
2025
'ignoreUrls': true,
2126
'ignoreTemplateLiterals': true,
@@ -35,9 +40,10 @@ module.exports = {
3540
'keyword-spacing': 'error',
3641
'no-multi-spaces': 'error',
3742
'no-restricted-syntax': ['error', 'WithStatement'],
43+
'no-undef': 'error',
3844
'no-unused-expressions': 'off',
3945
'no-unused-vars': ['error', { args: 'none', "ignoreRestSiblings": true }],
40-
'no-use-before-define': 'off',
46+
'no-use-before-define': ['error'],
4147
'nuxt/no-cjs-in-config': 'off',
4248
'prefer-const': ['error'],
4349
'no-var': ['error'],

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Created by .ignore support plugin (hsz.mobi)
1+
.vscode
2+
23
### Node template
34
# Logs
45
logs

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ ARG base_url
2525
ARG browser_base_url
2626
ARG yandex_metrika
2727
ARG sentry_dsn
28+
ARG recaptcha_site_key
2829

2930
ENV NODE_ENV $node_env
3031
ENV BASE_URL $base_url
3132
ENV BROWSER_BASE_URL $browser_base_url
3233
ENV YANDEX_METRIKA $yandex_metrika
3334
ENV SENTRY_DSN $sentry_dsn
35+
ENV RECAPTCHA_SITE_KEY $recaptcha_site_key
3436

3537
RUN npm run build

_tests_/smoke/api.test.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const testUser = {
99
};
1010

1111
describe('Login Endpoint', () => {
12-
it('shold return token', (done) => {
12+
it('should return token', (done) => {
1313
request(app.callback())
1414
.post('/auth/login')
1515
.send(testUser)
@@ -54,15 +54,18 @@ describe('getGolland Endpoint', () => {
5454
});
5555

5656
describe('gollandResults Endpoint', () => {
57-
it('should return dictionary with number for every type', (done) => {
57+
it('should return name, result and description in object for every type', (done) => {
5858
request(app.callback())
5959
.get('/api/gollandResults')
6060
.set('Authorization', token)
6161
.expect(200)
6262
.end((err, res) => {
6363
if (err) done(err);
6464

65-
expect(Object.values(res.body).every(val => isNumber(val))).toBe(true);
65+
expect(Object.values(res.body).every(val => isObject(val))).toBe(true);
66+
expect(Object.values(res.body).every(val => isString(val.name))).toBe(true);
67+
expect(Object.values(res.body).every(val => isString(val.descr))).toBe(true);
68+
expect(Object.values(res.body).every(val => isNumber(val.result))).toBe(true);
6669

6770
done();
6871
});
@@ -83,11 +86,6 @@ describe('gollandProfile Endpoint', () => {
8386
expect(isString(res.body.name)).toBe(true);
8487
expect(res.body).toHaveProperty('description');
8588
expect(isString(res.body.description)).toBe(true);
86-
expect(res.body).toHaveProperty('recommendations');
87-
expect(isObject(res.body.recommendations)).toBe(true);
88-
expect(res.body.recommendations.every(cur => {
89-
return Object.values(cur).every(val => !isObject(val));
90-
})).toBe(true);
9189

9290
done();
9391
});
@@ -194,7 +192,7 @@ describe('belbinResults Endpoint', () => {
194192
//=================DISK=============================
195193

196194
describe('getDisk Endpoint', () => {
197-
it('should return question and dictionary with variants of anwer for Belbin test', (done) => {
195+
it('should return question and dictionary with variants of answer for Belbin test', (done) => {
198196
request(app.callback())
199197
.get('/api/getDisk')
200198
.set('Authorization', token)
@@ -245,7 +243,7 @@ describe('diskResults Endpoint', () => {
245243
//=================Others=============================
246244

247245
describe('getProfession Endpoint', () => {
248-
const id = Math.floor(Math.random() * 80) + 1; // Random [1, 80]
246+
const id = Math.floor(Math.random() * 92) + 1; // Random [1, 80]
249247

250248
it(`should return dictionary with description of profession with id = ${id}`, (done) => {
251249
request(app.callback())
@@ -264,6 +262,7 @@ describe('getProfession Endpoint', () => {
264262
});
265263
});
266264

265+
267266
describe('recommendations Endpoint', () => {
268267
it('should return array of dictionaries with recommended professions', (done) => {
269268
request(app.callback())
@@ -277,9 +276,6 @@ describe('recommendations Endpoint', () => {
277276
expect(res.body.every(cur => {
278277
return Object.values(cur).every(val => !isObject(val));
279278
})).toBe(true);
280-
expect(res.body.every(cur => {
281-
return (difference(Object.keys(cur), ['id', 'name', 'image', 'smallDescr']).length === 0);
282-
})).toBe(true);
283279

284280
done();
285281
});

assets/bar-chart.png

2.03 KB
Loading

assets/career.png

1.82 KB
Loading

assets/cost.png

2.77 KB
Loading

assets/edu.png

2.96 KB
Loading

assets/example.png

10.9 KB
Loading

assets/failed-pay.png

26.3 KB
Loading

0 commit comments

Comments
 (0)