diff --git a/src/web/routes/case-routes.ts b/src/web/routes/case-routes.ts index 0cfc5f5d..7d295bb3 100644 --- a/src/web/routes/case-routes.ts +++ b/src/web/routes/case-routes.ts @@ -748,7 +748,7 @@ export function registerCaseRoutes( ? ApiErrorCode.ALREADY_EXISTS : ApiErrorCode.INVALID_INPUT, prepared.code === 'EXISTS' - ? `${customPath} already has files in it. Pick an empty folder, or a folder that does not exist yet.` + ? `${customPath} already has files in it. The clone target must be empty or not exist yet.` : prepared.reason ); } diff --git a/test/clone-custom-folder-ui.test.ts b/test/clone-custom-folder-ui.test.ts index 83cc4375..4e5e8a24 100644 --- a/test/clone-custom-folder-ui.test.ts +++ b/test/clone-custom-folder-ui.test.ts @@ -33,7 +33,7 @@ function bootClone() { const set = (id: string, value: string) => ((doc.getElementById(id) as HTMLInputElement).value = value); set('cloneRepoUrl', 'https://github.com/opticon454/bifrost'); set('cloneCaseName', 'bifrost'); - return { app, doc, set, fetchMock }; + return { app, doc, set, fetchMock, win }; } async function requestBody(fetchMock: ReturnType) { @@ -88,13 +88,13 @@ describe('Clone Repo custom folder', () => { }); it('previews the name taken from the URL as it is typed', () => { - const { app, doc, set } = bootClone(); + const { app, doc, set, win } = bootClone(); app.isCliAvailable = () => true; // lives in settings-ui.js, which this test does not load set('cloneCaseName', ''); set('cloneCasePath', '/mnt/projects'); set('cloneRepoUrl', 'https://github.com/opticon454/bifrost'); app.onCloneUrlInput(); - clearTimeout(app._clonePreflightTimer); + win.clearTimeout(app._clonePreflightTimer); expect((doc.getElementById('cloneCaseName') as HTMLInputElement).value).toBe('bifrost'); expect(doc.getElementById('cloneCasePathPreview')?.textContent).toBe('Will clone into: /mnt/projects/bifrost'); });