* chore(release): stop publishing legacy Windows update packages * feat(agents): support OpenCode Desktop across platforms Detect CLI and desktop installations on Windows, macOS, and Linux, and add separate launch and restart controls. Closes #156 * fix(codex): align model display names and show total session count - preserve runtime model identity in generated catalogs - count distinct sessions across database and rollout sources - update session count labels in all supported languages * fix(codex): keep config and auth files in sync - generate auth.json for API key configuration - preserve and validate OAuth credentials - include auth.json in transactional updates and rollback - retain compatibility with legacy Codex configuration states * fix(cpa-gui): update version to 0.2.59 in Cargo files * fix(codex): preserve OAuth mode after closing configuration * feat(config): add TLS management and protocol-aware local URLs - add TLS controls to advanced settings - persist certificate and private key paths - restart the core after TLS changes - switch WebUI, API and management URLs between HTTP and HTTPS - synchronize agent configurations and detection with the active protocol * refactor(config): reorganize network, routing, and TLS settings - split network settings and session routing into separate tabs - move TLS configuration into network settings - preserve TLS restart and HTTPS URL synchronization behavior * feat(config): add independent network settings and custom listen IP * fix(navigation): allow access to usage records while core is stopped * refactor(home): show a single API URL based on the configured listen IP * feat(config): add file pickers for TLS certificate and private key
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
import { appUpdateIndicatorState } from '../src/appUpdateModel';
|
|
import { canOpenAppPage, isAlwaysAvailablePage } from '../src/navigation';
|
|
import { oauthSubpages } from '../src/oauthNavigation';
|
|
|
|
describe('首页、配置与版本管理导航', () => {
|
|
test('内核停止时首页、配置和版本管理始终可进入', () => {
|
|
expect(isAlwaysAvailablePage('home')).toBe(true);
|
|
expect(isAlwaysAvailablePage('versions')).toBe(true);
|
|
expect(isAlwaysAvailablePage('config')).toBe(true);
|
|
expect(isAlwaysAvailablePage('usage-records')).toBe(true);
|
|
expect(canOpenAppPage('home', false)).toBe(true);
|
|
expect(canOpenAppPage('versions', false)).toBe(true);
|
|
expect(canOpenAppPage('config', false)).toBe(true);
|
|
expect(canOpenAppPage('usage-records', false)).toBe(true);
|
|
expect(canOpenAppPage('quota', false)).toBe(false);
|
|
});
|
|
|
|
test('内核运行后解锁其他功能页', () => {
|
|
expect(canOpenAppPage('config', true)).toBe(true);
|
|
expect(canOpenAppPage('agents', true)).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('OAuth 子页面导航', () => {
|
|
test('认证文件和额度查询收纳在 OAuth 页面内', () => {
|
|
expect(oauthSubpages.map((page) => page.id)).toEqual(['login', 'authFiles', 'quota']);
|
|
expect(oauthSubpages.map((page) => page.labelKey)).toEqual([
|
|
'oauth.title',
|
|
'authFiles.title',
|
|
'quota.title',
|
|
]);
|
|
});
|
|
});
|
|
|
|
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();
|
|
});
|
|
});
|