Skip to content

Commit

Permalink
Don't append a slash to file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemcdermott committed Mar 25, 2021
1 parent 9b702e4 commit 1da8956
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ const SCMSubForm = ({ autoPopulateProject, i18n }) => {
onSelect={(event, value) => {
setIsOpen(false);
value = value.trim();
if (!value.endsWith('/')) {
value += '/';
}
sourcePathHelpers.setValue(value);
}}
aria-label={i18n._(t`Select source path`)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('<SCMSubForm />', () => {
});
wrapper.update();
expect(wrapper.find('Select#source_path').prop('selections')).toEqual(
'bar/'
'bar'
);

await act(async () => {
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('<SCMSubForm />', () => {
customWrapper.find('Select').invoke('onSelect')({}, 'newPath');
});
customWrapper.update();
expect(customWrapper.find('Select').prop('selections')).toBe('newPath/');
expect(customWrapper.find('Select').prop('selections')).toBe('newPath');
});
test('Update on project update should be disabled', async () => {
const customInitialValues = {
Expand Down

0 comments on commit 1da8956

Please sign in to comment.