Don't append a slash to file paths

This commit is contained in:
Jake McDermott 2021-03-25 17:40:56 -04:00
parent 499d80c4b0
commit a86196cfa3
No known key found for this signature in database
GPG Key ID: 0E56ED990CDFCB4F
2 changed files with 2 additions and 9 deletions

View File

@ -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`)}
@ -132,10 +129,6 @@ const SCMSubForm = ({ autoPopulateProject, i18n }) => {
isCreatable
onCreateOption={value => {
value.trim();
if (!value.endsWith('/')) {
value += '/';
}
setSourcePath([...sourcePath, value]);
}}
>

View File

@ -98,7 +98,7 @@ describe('<SCMSubForm />', () => {
});
wrapper.update();
expect(wrapper.find('Select#source_path').prop('selections')).toEqual(
'bar/'
'bar'
);
await act(async () => {
@ -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 = {