feat: add account automation and isolated chat
- add account-level auto rating and daily polish tasks\n- add cached historical chat, media, emoji, and per-account realtime sync\n- add SQLite, MySQL, and PostgreSQL migrations and regression coverage\n- align account, sidebar, and chat interfaces with the new workflows
This commit is contained in:
1 parent
d7abbfb2b6
commit
67d7214930
59 files changed
+5202
-211
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { afterEach, describe, expect, test, vi } from 'vitest';
|
||||
import { readSidebarCollapsed, writeSidebarCollapsed } from './sidebarState';
|
||||
|
||||
afterEach(() => vi.unstubAllGlobals());
|
||||
|
||||
describe('sidebar persistence', () => {
|
||||
test('defaults to expanded and persists both states', () => {
|
||||
const values = new Map<string, string>();
|
||||
vi.stubGlobal('window', { localStorage: {
|
||||
getItem: (key: string) => values.get(key) ?? null,
|
||||
setItem: (key: string, value: string) => values.set(key, value),
|
||||
}});
|
||||
expect(readSidebarCollapsed()).toBe(false);
|
||||
writeSidebarCollapsed(true);
|
||||
expect(readSidebarCollapsed()).toBe(true);
|
||||
writeSidebarCollapsed(false);
|
||||
expect(readSidebarCollapsed()).toBe(false);
|
||||
});
|
||||
|
||||
test('storage failures safely fall back to expanded', () => {
|
||||
vi.stubGlobal('window', { localStorage: {
|
||||
getItem: () => { throw new Error('blocked'); },
|
||||
setItem: () => { throw new Error('blocked'); },
|
||||
}});
|
||||
expect(readSidebarCollapsed()).toBe(false);
|
||||
expect(() => writeSidebarCollapsed(true)).not.toThrow();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user