mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-27 00:38:47 +08:00
✨ feat(updater): 优化关于页更新信息展示
- 关于页直接进入 GoNavi 内容详情,减少二次点击 - 将更新通道改为分段选择器并优化描述布局 - 保留后端发布发布时间元数据并在版本信息中展示
This commit is contained in:
@@ -221,6 +221,30 @@ describe('useAppUpdateManager', () => {
|
||||
expect(hook?.lastUpdateInfo?.channel).toBe('dev');
|
||||
});
|
||||
|
||||
it('keeps release metadata from the backend update response', async () => {
|
||||
backendApp.CheckForUpdates.mockResolvedValue({
|
||||
success: true,
|
||||
data: {
|
||||
hasUpdate: true,
|
||||
currentVersion: '0.8.1',
|
||||
latestVersion: '0.8.2',
|
||||
releaseName: 'Dev Build (dev-22fab86)',
|
||||
releasePublishedAt: '2026-07-08T11:15:00Z',
|
||||
releaseNotesUrl: 'https://github.com/Syngnat/GoNavi/releases/tag/dev-latest',
|
||||
},
|
||||
});
|
||||
|
||||
renderHook();
|
||||
|
||||
await act(async () => {
|
||||
await hook?.checkForUpdates(false);
|
||||
});
|
||||
|
||||
expect(hook?.lastUpdateInfo?.releaseName).toBe('Dev Build (dev-22fab86)');
|
||||
expect(hook?.lastUpdateInfo?.releasePublishedAt).toBe('2026-07-08T11:15:00Z');
|
||||
expect(hook?.lastUpdateInfo?.releaseNotesUrl).toBe('https://github.com/Syngnat/GoNavi/releases/tag/dev-latest');
|
||||
});
|
||||
|
||||
it('opens the downloaded update directory when a package is already downloaded', async () => {
|
||||
backendApp.CheckForUpdates.mockResolvedValue({
|
||||
success: true,
|
||||
|
||||
@@ -13,6 +13,7 @@ export type UpdateInfo = {
|
||||
currentVersion: string;
|
||||
latestVersion: string;
|
||||
releaseName?: string;
|
||||
releasePublishedAt?: string;
|
||||
releaseNotesUrl?: string;
|
||||
assetName?: string;
|
||||
assetUrl?: string;
|
||||
|
||||
Reference in New Issue
Block a user