Skip to content

Commit

Permalink
test(CustomFileInput): removes fakepath from file name
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ellingsworth authored and David Ellingsworth committed Aug 22, 2019
1 parent def734d commit 2f4b6b6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/CustomInput.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ describe('Custom Inputs', () => {
expect(onChange).toHaveBeenCalled();
});
});

it('removes fakepath from file name', () => {
const file = mount(<CustomInput type="file" />);

file.find('input').hostNodes().simulate('change', {
target:{
value:'C:\\fakepath\\test.txt'
}
});

expect(file.find('.custom-file-label').text()).toBe('test.txt');
});
});

describe('CustomRange', () => {
Expand Down

0 comments on commit 2f4b6b6

Please sign in to comment.