feat: settings panel

This commit is contained in:
2026-02-10 16:38:20 +01:00
parent 192969e75a
commit 3f0c767809
14 changed files with 1482 additions and 88 deletions

View File

@@ -861,8 +861,8 @@ describe('DropboxSyncEngine', () => {
}));
});
it('should start watching local directories', () => {
engine.startWatching();
it('should start watching local directories', async () => {
await engine.startWatching();
expect(mockChokidarWatch).toHaveBeenCalledWith(
expect.arrayContaining([
@@ -876,45 +876,45 @@ describe('DropboxSyncEngine', () => {
);
});
it('should set status to watching when watching starts', () => {
engine.startWatching();
it('should set status to watching when watching starts', async () => {
await engine.startWatching();
expect(engine.getStatus()).toBe('watching');
});
it('should stop watching when requested', () => {
engine.startWatching();
it('should stop watching when requested', async () => {
await engine.startWatching();
engine.stopWatching();
expect(mockWatcher.close).toHaveBeenCalled();
});
it('should set status to idle when watching stops', () => {
engine.startWatching();
it('should set status to idle when watching stops', async () => {
await engine.startWatching();
engine.stopWatching();
expect(engine.getStatus()).toBe('idle');
});
it('should emit watchStarted event', () => {
it('should emit watchStarted event', async () => {
const handler = vi.fn();
engine.on('watchStarted', handler);
engine.startWatching();
await engine.startWatching();
expect(handler).toHaveBeenCalled();
});
it('should emit watchStopped event', () => {
it('should emit watchStopped event', async () => {
const handler = vi.fn();
engine.on('watchStopped', handler);
engine.startWatching();
await engine.startWatching();
engine.stopWatching();
expect(handler).toHaveBeenCalled();
});
it('should register add, change, and unlink handlers', () => {
engine.startWatching();
it('should register add, change, and unlink handlers', async () => {
await engine.startWatching();
const onCalls = mockWatcher.on.mock.calls.map((call: any[]) => call[0]);
expect(onCalls).toContain('add');