@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
32 lines (26 loc) • 939 B
text/typescript
import { UserStore } from '@/store/user';
import { UserState, initialState } from '@/store/user/initialState';
import { merge } from '@/utils/merge';
import { userGeneralSettingsSelectors } from './general';
describe('settingsSelectors', () => {
describe('currentThemeMode', () => {
it('should return the correct theme', () => {
const s: UserState = merge(initialState, {
settings: {
general: { themeMode: 'light' },
},
});
const result = userGeneralSettingsSelectors.currentThemeMode(s as UserStore);
expect(result).toBe('light');
});
it('should return the auto if not set the themeMode', () => {
const s: UserState = merge(initialState, {
settings: {
general: { themeMode: undefined },
},
});
const result = userGeneralSettingsSelectors.currentThemeMode(s as UserStore);
expect(result).toBe('auto');
});
});
});