- Added new fields for proxy URL, session affinity, and session affinity TTL in usage tracking. - Updated tauri configuration to increase window width. - Expanded Japanese and Chinese translations for new error messages and notices related to network settings. - Introduced new network configuration panel in the UI, allowing users to set port, LAN access, proxy URL, and session affinity options. - Implemented validation for port input and added error handling for network settings. - Refactored API access logic to support new provider record management functions. - Updated navigation to ensure the config page is always accessible. - Added tests for new provider record functionalities and network settings.
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
import { appUpdateIndicatorState } from '../src/appUpdateModel';
|
|
import { canOpenAppPage, isAlwaysAvailablePage } from '../src/navigation';
|
|
|
|
describe('首页、配置与版本管理导航', () => {
|
|
test('内核停止时首页、配置和版本管理始终可进入', () => {
|
|
expect(isAlwaysAvailablePage('home')).toBe(true);
|
|
expect(isAlwaysAvailablePage('versions')).toBe(true);
|
|
expect(isAlwaysAvailablePage('config')).toBe(true);
|
|
expect(canOpenAppPage('home', false)).toBe(true);
|
|
expect(canOpenAppPage('versions', false)).toBe(true);
|
|
expect(canOpenAppPage('config', false)).toBe(true);
|
|
expect(canOpenAppPage('quota', false)).toBe(false);
|
|
});
|
|
|
|
test('内核运行后解锁其他功能页', () => {
|
|
expect(canOpenAppPage('config', true)).toBe(true);
|
|
expect(canOpenAppPage('agents', true)).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('软件更新导航提示点', () => {
|
|
test('有新版显示橙点,处理中的蓝点优先', () => {
|
|
expect(appUpdateIndicatorState(true, false)).toBe('available');
|
|
expect(appUpdateIndicatorState(true, true)).toBe('processing');
|
|
expect(appUpdateIndicatorState(false, true)).toBe('processing');
|
|
});
|
|
|
|
test('最新版或检查失败都不显示提示点', () => {
|
|
expect(appUpdateIndicatorState(false, false)).toBeNull();
|
|
});
|
|
});
|