1
0
Fork 0

[DEV-2871] Added field type to DocumentProgramFormatter

master
Mark Goldsmith 2018-06-07 15:54:09 -04:00
parent 856c9a1a83
commit e2461a023c
2 changed files with 8 additions and 0 deletions

View File

@ -177,11 +177,13 @@ module.exports = Class( 'DocumentProgramFormatter',
const field_value = bucket.getDataByName( field_id );
const field_label = this._program.fields[ field_id ].label;
const field_type = this._program.fields[ field_id ].type;
const question = {};
question.id = field_id;
question.label = field_label;
question.value = field_value;
question.type = field_type;
question.applicable = this._getApplicable(
classes,
field_id,

View File

@ -64,18 +64,21 @@ describe( 'DocumentProgramFormatter', () =>
id: "sell_alcohol",
label: "Does the insured sell alcohol?",
value: [ "foo", "" ],
type: "noyes",
applicable: [ true, false ]
},
{
id: "serve_alcohol",
label: "Does the insured serve alcohol?",
value: [ "" ],
type: "noyes",
applicable: [ false ]
},
{
id: "field_no_vis",
label: "Does this field have a visibility class?",
value: [ "true" ],
type: "noyes",
applicable: [ true ]
}
]
@ -87,18 +90,21 @@ describe( 'DocumentProgramFormatter', () =>
id: "sell_ecigs",
label: "Does the insured sell e-cigarettes?",
value: [ "", "bar" ],
type: "noyes",
applicable: [ false, true ]
},
{
id: "dist_ecigs",
label: "Does the Insured distribute Electronic Cigarette products?",
value: [ "" ],
type: "noyes",
applicable: [ false ]
},
{
id: "field_no_array",
label: "Does this field have an array for the visibility class?",
value: [ "bar" ],
type: "noyes",
applicable: [ true ]
}
]