From edc0aa2777137b0e11100ef40ae8dfee49805fef Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Tue, 16 Apr 2019 17:52:11 -0400 Subject: [PATCH] test(CustomFileInput): removes fakepath from file name --- src/__tests__/CustomInput.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/__tests__/CustomInput.spec.js b/src/__tests__/CustomInput.spec.js index e851bdcad..d9ed75e41 100644 --- a/src/__tests__/CustomInput.spec.js +++ b/src/__tests__/CustomInput.spec.js @@ -274,6 +274,18 @@ describe('Custom Inputs', () => { 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'); + }); }); describe('CustomRange', () => {