test(clone): cover the preview refresh on URL input

This commit is contained in:
Devvyn committed 2026-11-06 14:00:32 +08:00
1 parent a4bd35b704
commit ec4c901190
1 file changed
+12
+12
View File
@@ -86,4 +86,16 @@ describe('Clone Repo custom folder', () => {
expect((doc.getElementById('cloneCaseName') as HTMLInputElement).value).toBe('bifrost');
expect(doc.getElementById('cloneCasePathPreview')?.textContent).toBe('Will clone into: /mnt/projects/bifrost');
});
it('previews the name taken from the URL as it is typed', () => {
const { app, doc, set } = 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);
expect((doc.getElementById('cloneCaseName') as HTMLInputElement).value).toBe('bifrost');
expect(doc.getElementById('cloneCasePathPreview')?.textContent).toBe('Will clone into: /mnt/projects/bifrost');
});
});