Skip to content

Commit

Permalink
fix(seeds): ensure proper data for expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 3, 2020
1 parent be2cf87 commit 0ab4060
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 168 deletions.
215 changes: 60 additions & 155 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -96,7 +96,7 @@
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsdoc": "^26.0.1",
"eslint-plugin-jsdoc": "^27.0.2",
"eslint-plugin-mocha": "^7.0.1",
"eslint-plugin-prettier": "^3.1.3",
"generate-changelog": "^1.8.0",
Expand All @@ -105,30 +105,30 @@
"lint-staged": "^10.2.7",
"lodash.template": "^4.5.0",
"mocha": "^7.2.0",
"mongoose": ">=5.9.16",
"mongoose": ">=5.9.17",
"npm-check-updates": "^6.0.1",
"nyc": "^15.0.1",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"rollup": "^2.12.0",
"rollup": "^2.12.1",
"shelljs": "^0.8.4"
},
"peerDependencies": {
"mongoose": ">=5.9.16"
"mongoose": ">=5.9.17"
},
"dependencies": {
"@codetanzania/emis-stakeholder": ">=2.8.0",
"@codetanzania/ewea-common": ">=0.16.0",
"@codetanzania/ewea-common": ">=0.18.0",
"@codetanzania/ewea-dispatch": ">=0.6.0",
"@codetanzania/ewea-event": ">=0.11.0",
"@codetanzania/ewea-internals": ">=0.17.1",
"@codetanzania/ewea-internals": ">=0.19.0",
"@lykmapipo/common": ">=0.34.2",
"@lykmapipo/env": ">=0.17.7",
"@lykmapipo/express-common": ">=0.18.5",
"@lykmapipo/express-rest-actions": ">=0.8.17",
"@lykmapipo/file": ">=0.1.26",
"@lykmapipo/mongoose-aggregatable": ">=0.3.3",
"@lykmapipo/mongoose-common": ">=0.34.3",
"@lykmapipo/mongoose-common": ">=0.35.0",
"@lykmapipo/mongoose-exportable": ">=0.3.30",
"@lykmapipo/mongoose-sequenceable": ">=0.2.16",
"@lykmapipo/postman": ">=0.18.13",
Expand Down
Empty file added test/expectations/.gitkeep
Empty file.
File renamed without changes.
48 changes: 48 additions & 0 deletions test/fixtures/cases.js
@@ -0,0 +1,48 @@
const cases = [
{
_id: '5eb20aaadcf2bd6aae15b4d0',
number: '2020-O5-0001-TZ',
victim: {
referral: '85623679',
pcr: '95623679',
name: 'Jane Mode',
mobile: '255714117841',
age: 30,
weight: 51,
address: 'Tandale',
nextOfKin: { name: 'Asha Mdoe', mobile: '255714104893' },
},
description: 'Severe injury from Floods.',
reportedAt: '2020-05-04T02:48:48.323Z',
createdAt: '2020-05-04T02:48:48.323Z',
resolvedAt: '2020-05-04T02:59:48.323Z',
remarks: 'Handled.',
populate: {
reporter: {
match: { name: 'Ali Mdoe' },
model: 'Party',
},
resolver: {
match: { name: 'Ali Mdoe' },
model: 'Party',
},
'victim.gender': {
match: { namespace: 'PartyGender', 'strings.name.en': 'Female' },
model: 'Predefine',
},
'victim.occupation': {
match: {
namespace: 'PartyGender',
'strings.name.en': 'Health Care Worker',
},
model: 'Predefine',
},
'victiom.area': {
match: { namespace: 'AdministrativeArea', 'strings.name.en': 'Ilala' },
model: 'Predefine',
},
},
},
];

export default cases;
2 changes: 1 addition & 1 deletion test/integration/dispatch.aggregations.spec.js
Expand Up @@ -9,7 +9,7 @@ import {
getDispatchAnalysis,
} from '../../src';

import { dispatchOverview } from '../fixtures/expectations';
import { dispatchOverview } from '../expectations';

describe('Dispatch Aggregations', () => {
it('should provide base aggregations', (done) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/event.aggregations.spec.js
Expand Up @@ -9,7 +9,7 @@ import {
getEventAnalysis,
} from '../../src';

import { eventOverview } from '../fixtures/expectations';
import { eventOverview } from '../expectations';

describe('Event Aggregations', () => {
it('should provide base aggregations', (done) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/overview.aggregations.spec.js
Expand Up @@ -9,7 +9,7 @@ import {
partyOverview,
eventOverview,
dispatchOverview,
} from '../fixtures/expectations';
} from '../expectations';

describe('Overview Aggregations', () => {
it('should provide overview analysis', (done) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/party.aggregations.spec.js
Expand Up @@ -9,7 +9,7 @@ import {
getPartyAnalysis,
} from '../../src';

import { partyOverview } from '../fixtures/expectations';
import { partyOverview } from '../expectations';

describe('Party Aggregations', () => {
it('should provide base aggregations', (done) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/report.http.router.spec.js
Expand Up @@ -7,7 +7,7 @@ import {
partyOverview,
eventOverview,
dispatchOverview,
} from '../fixtures/expectations';
} from '../expectations';

describe('Reports Rest API', () => {
before(() => clearHttp());
Expand Down

0 comments on commit 0ab4060

Please sign in to comment.