Skip to content

Commit

Permalink
Add test forms for convert-app-forms
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jul 26, 2017
1 parent 7213b3a commit 16a457c
Show file tree
Hide file tree
Showing 26 changed files with 8,734 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build/
/node_modules/
20 changes: 11 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"homepage": "https://github.com/alxndrsn/medic-configurer#readme",
"dependencies": {
"mkdirp": "^0.5.1",
"pouchdb": "^6.2.0",
"readline-sync": "^1.4.7",
"redact-basic-auth": "^0.1.1",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/sync-fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const fs = require('fs');
const mkdirp = require('mkdirp').sync;
const os = require('os');
const path = require('path');
const trace = require('../lib/log').trace;
Expand Down Expand Up @@ -50,7 +51,7 @@ function withoutExtension(fileName) {
module.exports = {
copy: (from, to) => fs.writeFileSync(to, fs.readFileSync(from)),
exists: fs.existsSync,
mkdir: path => { try { fs.mkdirSync(path); } catch(e) { /* yum yum */ } },
mkdir: path => { try { mkdirp(path); } catch(e) { warn(e); } },
mkdtemp: () => fs.mkdtempSync(`${os.tmpdir()}/medic-conf`),
path: path,
posixPath: p => p.split(path.sep).join('/'),
Expand Down
34 changes: 34 additions & 0 deletions test/data/fn/convert-app-forms/delivery.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": [
{
"locale": "en",
"content": "Delivery"
},
{
"locale": "hi",
"content": "डिलिवरी रिपोर्ट"
},
{
"locale": "id",
"content": "Laporan persalinan"
}
],
"icon": "mother-child",
"context": {
"person": true,
"place": false,
"expression": "!contact || (contact.type === 'person' && (!contact.sex || contact.sex === 'female') && (!contact.date_of_birth || (ageInYears(contact) >= 10 && ageInYears(contact) < 65)))"
},
"hidden_fields": [
"inputs",
"patient_uuid",
"geolocation",
"patient_age_in_years",
"patient_contact_phone",
"group_chw_info",
"group_delivery_summary",
"group_note",
"group_summary",
"meta"
]
}
Binary file added test/data/fn/convert-app-forms/delivery.xlsx
Binary file not shown.
Loading

0 comments on commit 16a457c

Please sign in to comment.