Fixed Jasmine test cases.

This commit is contained in:
Aditya Toshniwal
2022-03-24 12:05:59 +05:30
committed by Akshay Joshi
parent 2f37f0ca51
commit 7f2e87b27d
5 changed files with 19 additions and 13 deletions

View File

@@ -93,7 +93,7 @@ function isValueEqual(val1, val2) {
return (_.isEqual(val1, val2)
|| ((val1 === null || _.isUndefined(val1)) && val2 === '')
|| ((val1 === null || _.isUndefined(val1)) && typeof(val2) === 'boolean' && !val2)
|| (attrDefined ? _.isEqual(val1.toString(), val2.toString()) : false
|| (attrDefined ? (!_.isObject(val1) && _.isEqual(val1.toString(), val2.toString())) : false
));
}
@@ -108,7 +108,7 @@ function getChangedData(topSchema, viewHelperProps, sessData, stringify=false, i
/* The comparator and setter */
const attrChanged = (id, change, force=false)=>{
if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force && (_.isObject(_.get(origVal, id)) && _.isEqual(_.get(origVal, id), _.get(sessData, id)))) {
if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force) {
return;
} else {
change = change || _.get(sessVal, id);

View File

@@ -28,16 +28,13 @@ export default function SelectThemes({onChange, ...props}) {
props.options.forEach((opt)=> {
if(opt.value == e) {
setPreviewSrc(opt.preview_src);
}
}
});
onChange(e);
};
return (
<Grid
container
direction="column"
justifyContent="center">
<Grid container direction="column">
<Grid item lg={12} md={12} sm={12} xs={12}>
<InputSelect ref={props.inputRef} onChange={themeChange} {...props} />
</Grid>
@@ -55,4 +52,4 @@ SelectThemes.propTypes = {
fields: PropTypes.array,
options: PropTypes.array,
inputRef: CustomPropTypes.ref
};
};