Fixed code smell 'Update this function so that its implementation is not identical' reported by SonarQube.

This commit is contained in:
Akshay Joshi
2022-01-28 17:20:34 +05:30
parent 37d82d457c
commit 1a89c1f85f
72 changed files with 579 additions and 4126 deletions
@@ -51,6 +51,16 @@ describe('FormComponents', ()=>{
jasmineEnzyme();
});
let onAccessibility = (ctrl)=> {
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
expect(inputProps).toEqual(jasmine.objectContaining({
id: 'inpCid',
'aria-describedby': 'hinpCid',
}));
};
describe('FormInputText', ()=>{
let ThemedFormInputText = withTheme(FormInputText), ctrl;
@@ -99,13 +109,7 @@ describe('FormComponents', ()=>{
});
it('accessibility', ()=>{
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
expect(inputProps).toEqual(jasmine.objectContaining({
id: 'inpCid',
'aria-describedby': 'hinpCid',
}));
onAccessibility(ctrl);
});
});
@@ -167,13 +171,7 @@ describe('FormComponents', ()=>{
});
it('accessibility', ()=>{
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
expect(inputProps).toEqual(jasmine.objectContaining({
id: 'inpCid',
'aria-describedby': 'hinpCid',
}));
onAccessibility(ctrl);
});
});