Skip to content

Commit

Permalink
Revert "Add unit test for stock out"
Browse files Browse the repository at this point in the history
This reverts commit c9a7dc6.
  • Loading branch information
ernestoteo committed Nov 5, 2024
1 parent ddeeabe commit 6b6c4f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 85 deletions.
10 changes: 1 addition & 9 deletions src/add-feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ async function selectFeature(configs) {
choices: remainingFeatures.map((ft) => ({
name: FEATURES[ft],
value: ft,
})),
when: function (answers){
const argv = process.argv;
if (!argv[4]){
return true;
}
answers.name = argv[4];
return false;
}
}))
}
]);

Expand Down
34 changes: 2 additions & 32 deletions src/features/stock-out.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,7 @@ async function getStockOutConfigs({
type: 'input',
name: 'form_name',
message: 'Enter stock out form ID',
default: 'stock_out',
when: function (answers){
const argv = process.argv;
if (!argv[5]){
return true;
}
answers.form_name = argv[5];
return false;
}
default: 'stock_out'
},
{
type: 'list',
Expand All @@ -287,34 +279,12 @@ async function getStockOutConfigs({
value: 'weekly_qty'
}
],
when: function (answers){
const argv = process.argv;
if (!argv[6]){
return true;
}
answers.formular = argv[6];
return false;
}
},
...languages.map((language) => ({
type: 'input',
name: `title.${language}`,
message: `Enter stock out form title in ${language}`,
default: 'Stock Out',
when: function (answers){
const argv = process.argv;
if (!argv[7]){
return true;
}
const answer = {
title:{
'en': argv[7].split(',')[0],
'fr': argv[7].split(',')[1]
}
};
Object.assign(answers, answer);
return false;
}
default: 'Stock Out'
}))
]);
return configs;
Expand Down
44 changes: 0 additions & 44 deletions test/mocks/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,50 +129,6 @@ module.exports = {
'paracetamol___count'
]

},

stockOutScenario: {
initScenario: [
'init',
'2_levels',
'c62_chw',
'chw',
'c52_supervisor',
'supervisor',
'Y',
'stock_count',
'[{contact_type: \'c62_chw\', role: \'chw\', place_type: \'c60_chw_site\' },{contact_type: \'c52_supervisor\',role: \'supervisor\',place_type: \'c50_supervision_area\'}]',
'action',
'end_of_week',
['Stock count', 'Stock count'],
'patient_assessment_under_5',
'Y',
'now()',
'malaria',
['Category', 'Categorie'],
['Category', 'Categorie'],
'paracetamol',
['Paracetamol', 'Paracetamole'],
'Y',
['Box of 8', 'Boite de 8'],
8,
['Tablet', 'Comprimes'],
20,
15,
15,
'by_user',
0,
],
addStockOutFeatureScenario: [
'add', 'feature', 'stock_out', 'stock_out', 'item_danger_qty', ['Stock Out', 'Stock Out']
],
productsScenario: [
'paracetamol_at_hand___set',
'paracetamol_at_hand___unit',
'paracetamol_required___set',
'paracetamol_required___unit'
]

}
};

Expand Down

0 comments on commit 6b6c4f5

Please sign in to comment.