mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-04 18:33:22 -05:00
Fixed code smell 'Update this function so that its implementation is not identical' reported by SonarQube.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user