Keeps embedded sessions aligned with parent theme Prevents iframe reloads on theme changes Supports theme hotkeys from focused iframes
31 lines
853 B
TypeScript
31 lines
853 B
TypeScript
import { beforeEach, describe, expect, test } from 'bun:test';
|
|
import { useUIStore } from './useUIStore';
|
|
|
|
beforeEach(() => {
|
|
useUIStore.setState({ contextPanelByDirectory: {} });
|
|
});
|
|
|
|
describe('useUIStore context panel tabs', () => {
|
|
test('updates readOnly when an existing chat tab is reopened', () => {
|
|
const directory = '/repo';
|
|
|
|
useUIStore.getState().openContextPanelTab(directory, {
|
|
mode: 'chat',
|
|
dedupeKey: 'session:ses_1',
|
|
label: 'Session',
|
|
readOnly: true,
|
|
});
|
|
|
|
useUIStore.getState().openContextPanelTab(directory, {
|
|
mode: 'chat',
|
|
dedupeKey: 'session:ses_1',
|
|
label: 'Session',
|
|
readOnly: false,
|
|
});
|
|
|
|
const tabs = useUIStore.getState().contextPanelByDirectory[directory]?.tabs ?? [];
|
|
expect(tabs).toHaveLength(1);
|
|
expect(tabs[0]?.readOnly).toBe(false);
|
|
});
|
|
});
|