@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.
56 lines (49 loc) • 1.55 kB
text/typescript
import { describe, expect, it } from 'vitest';
import { ElectronState } from '@/store/electron/initialState';
import { desktopStateSelectors } from '../desktopState';
describe('desktopStateSelectors', () => {
describe('usePath', () => {
it('should return userPath from appState', () => {
const state: ElectronState = {
isAppStateInit: false,
appState: {
userPath: {
desktop: '/test/desktop',
documents: '/test/documents',
downloads: '/test/downloads',
home: '/test/home',
music: '/test/music',
pictures: '/test/pictures',
userData: '/test/userdata',
videos: '/test/videos',
},
},
dataSyncConfig: {
storageMode: 'local',
},
isInitRemoteServerConfig: false,
};
expect(desktopStateSelectors.usePath(state)).toEqual({
desktop: '/test/desktop',
documents: '/test/documents',
downloads: '/test/downloads',
home: '/test/home',
music: '/test/music',
pictures: '/test/pictures',
userData: '/test/userdata',
videos: '/test/videos',
});
});
it('should handle undefined userPath', () => {
const state: ElectronState = {
appState: {},
isAppStateInit: false,
dataSyncConfig: {
storageMode: 'local',
},
isInitRemoteServerConfig: false,
};
expect(desktopStateSelectors.usePath(state)).toBeUndefined();
});
});
});