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 Apr 16, 2019
1 parent ebbfc69 commit edc0aa2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/CustomInput.spec.js
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 edc0aa2

Please sign in to comment.