diff --git a/src/__tests__/CustomInput.spec.js b/src/__tests__/CustomInput.spec.js
index e0f3ef361..7eec0ce97 100644
--- a/src/__tests__/CustomInput.spec.js
+++ b/src/__tests__/CustomInput.spec.js
@@ -264,6 +264,45 @@ describe('Custom Inputs', () => {
expect(ref.current).not.toBeNull();
expect(ref.current).toBeInstanceOf(HTMLInputElement);
});
+
+ describe('onChange', () => {
+ it('calls props.onChange if it exists', () => {
+ const onChange = jest.fn();
+ const file = mount();
+
+ file.find('input').hostNodes().simulate('change');
+ expect(onChange).toHaveBeenCalled();
+ });
+ });
+
+ it('removes fakepath from file name', () => {
+ const file = mount();
+
+ file.find('input').hostNodes().simulate('change', {
+ target:{
+ value:'C:\\fakepath\\test.txt'
+ }
+ });
+
+ expect(file.find('.custom-file-label').text()).toBe('test.txt');
+ });
+
+ it('lists multiple files when supported', () => {
+ const file = mount();
+
+ file.find('input').hostNodes().simulate('change', {
+ target:{
+ value:'C:\\fakepath\\file1.txt',
+ files:[
+ {name:"file1.txt"},
+ {name:'file2.txt'},
+ {name:'file3.txt'},
+ ]
+ }
+ })
+
+ expect(file.find('.custom-file-label').text()).toBe('file1.txt, file2.txt, file3.txt');
+ })
});
describe('CustomRange', () => {