Skip to content

Commit

Permalink
Add "templated" extension on contact summary and test directories on …
Browse files Browse the repository at this point in the history
…initialise-project-layout (#470)

* add test directories on initialise-project-layout

* add some lines in contact-summary
  • Loading branch information
jonathanbataire authored Aug 15, 2022
1 parent d015199 commit 01fcfb7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/fn/initialise-project-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ const fs = require('../lib/sync-fs');
const { info } = require('../lib/log');

const LAYOUT = {
'contact-summary.js': '',
'contact-summary.templated.js': `module.exports = {
fields: [],
cards: [],
context: {}
};`,
'privacy-policies.json': {},
'privacy-policies': {},
'resources.json': {},
'harness.defaults.json': {},
resources: {},
'targets.js': 'module.exports = [];',
'tasks.js': 'module.exports = [];',
Expand All @@ -32,6 +37,12 @@ const LAYOUT = {
'forms.json': {},
'schedules.json': [],
},
test: {
forms: {},
'contact-summary': {},
tasks: {},
targets: {}
}
};

function createRecursively(dir, layout) {
Expand Down
7 changes: 6 additions & 1 deletion test/fn/initialise-project-layout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('initialise-project-layout', () => {
initialiseProjectLayout.execute();

// then
assertExists('contact-summary.js');
assertExists('contact-summary.templated.js');
assertExists('forms/app');
assertExists('forms/collect');
assertExists('forms/contact');
Expand All @@ -30,6 +30,11 @@ describe('initialise-project-layout', () => {
assertExists('app_settings/base_settings.json');
assertExists('app_settings/forms.json');
assertExists('app_settings/schedules.json');
assertExists('harness.defaults.json');
assertExists('test/forms');
assertExists('test/contact-summary');
assertExists('test/tasks');
assertExists('test/targets');
});
});

Expand Down

0 comments on commit 01fcfb7

Please sign in to comment.