forked from premieroctet/openchakra
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sosynpl[premieroctet#120]: changed announce regions to mobility_regio…
…ns, test if mobility_city is known
- Loading branch information
1 parent
fa60d5c
commit 79e4fad
Showing
6 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const mongoose = require('mongoose') | ||
const lodash = require('lodash') | ||
const { MONGOOSE_OPTIONS } = require('../../server/utils/database') | ||
const Freelance = require('../../server/models/Freelance') | ||
const JobFile = require('../../server/models/JobFile') | ||
const { JOB_FILE_DATA, JOB_DATA, SECTOR_DATA, CATEGORY_DATA, FREELANCE_DATA, CUSTOMER_DATA } = require('./data/base_data') | ||
const Job = require('../../server/models/Job') | ||
const Sector = require('../../server/models/Sector') | ||
const HardSkillCategory = require('../../server/models/HardSkillCategory') | ||
const HardSkill = require('../../server/models/HardSkill') | ||
const Customer = require('../../server/models/Customer') | ||
const Announce = require('../../server/models/Announce') | ||
const { EXPERIENCE, DURATION_UNIT_DAYS, DURATION_UNIT, MOBILITY_NONE, DURATION_MONTH } = require('../../server/plugins/sosynpl/consts') | ||
|
||
jest.setTimeout(30000000) | ||
|
||
describe('Evaluation', ()=> { | ||
let freelanceId, customerId, announce, application, evaluation, sector | ||
beforeAll(async () => { | ||
const DBNAME=`evalTest` | ||
await mongoose.connect(`mongodb://localhost/${DBNAME}`, MONGOOSE_OPTIONS) | ||
console.log('Opened database', DBNAME) | ||
const jobFile=await JobFile.create({...JOB_FILE_DATA}) | ||
const job=await Job.create({...JOB_DATA, job_file: jobFile}) | ||
const sector=await Sector.create({...SECTOR_DATA}) | ||
const category1=await HardSkillCategory.create({...CATEGORY_DATA, name: `Catégorie 1`}) | ||
const category2=await HardSkillCategory.create({...CATEGORY_DATA, name: `Catégorie 2`}) | ||
freelanceId=(await Freelance.create({...FREELANCE_DATA, main_job: job, work_sector: [sector]}))._id | ||
await Promise.all(lodash.range(4).map(idx => HardSkill.create({name: `Skill 1-${idx}`, code: '12', job_file: jobFile, category: category1}))) | ||
await Promise.all(lodash.range(2).map(idx => HardSkill.create({name: `Skill 2-${idx}`, code: '12', job_file: jobFile, category: category2}))) | ||
|
||
const rouen = { | ||
address: 'Place du Vieux-Marché', | ||
city: 'Rouen', | ||
zip_code: '76000', | ||
country: 'France', | ||
latitude: 49.4431, | ||
longitude: 1.0993, | ||
} | ||
|
||
customerId=await Customer.create({...CUSTOMER_DATA})._id | ||
|
||
const announce=await Announce.create({ | ||
user:customerId, | ||
title:'dev', | ||
experience: Object.keys(EXPERIENCE)[0], | ||
duration: 2, | ||
duration_unit: DURATION_MONTH, | ||
budget: '6969669', | ||
mobility_days_per_month : 2, | ||
mobility: MOBILITY_NONE, | ||
city: rouen, | ||
sectors: [sector._id] | ||
}) | ||
}) | ||
|
||
afterAll(async () => { | ||
await mongoose.connection.dropDatabase() | ||
await mongoose.connection.close() | ||
}) | ||
|
||
it('must get evaluations', async()=>{ | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"jodit-react": "^4.1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
autobind-decorator@^2.4.0: | ||
version "2.4.0" | ||
resolved "https://registry.yarnpkg.com/autobind-decorator/-/autobind-decorator-2.4.0.tgz#ea9e1c98708cf3b5b356f7cf9f10f265ff18239c" | ||
integrity sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw== | ||
|
||
jodit-react@^4.1.2: | ||
version "4.1.2" | ||
resolved "https://registry.yarnpkg.com/jodit-react/-/jodit-react-4.1.2.tgz#61ef1d6fa1f37cde7b71f666da8be9f6fb70f913" | ||
integrity sha512-Hs1evpM1IK5zvy/5m5Gk819L8aC+9EmEdQvCoLHVUr/R3vtH4nYFD6wsMRj3ur3J4ZHhaSBjt0N3R7ggwP405Q== | ||
dependencies: | ||
jodit "^4.2.10" | ||
|
||
jodit@^4.2.10: | ||
version "4.2.27" | ||
resolved "https://registry.yarnpkg.com/jodit/-/jodit-4.2.27.tgz#fd6b39a968bd474210e8ab78fc463cdb206d3a6d" | ||
integrity sha512-cqqeunB3HMElnocVhs5Qq2bhgpMIT2vKQPBpKcOTWKvX6GJ0GYAIneMEf43lphJuo+119CvBE8YgljD5iTfsAQ== | ||
dependencies: | ||
autobind-decorator "^2.4.0" |