feat: show system update history as timeline
Release / release (push) Canceled after 0s

This commit is contained in:
Qiufeng
2026-08-19 07:26:48 +08:00
parent 12d9c46323
commit de63fcffff
4 changed files with 549 additions and 49 deletions
+12 -3
View File
@@ -138,6 +138,7 @@ async function installFixture(
beforeJson: null,
afterJson: JSON.stringify({
targetVersion,
...(actionCode === 'SYSTEM_UPDATE_CHECK' ? { releaseNotes: 'Preview update' } : {}),
...(actionCode === 'SYSTEM_UPDATE_SUCCEEDED' ? { state: 'SUCCEEDED' } : {}),
}),
occurredAt: '2026-08-16T00:02:00Z',
@@ -415,9 +416,17 @@ test('successful installation starts the ten-second automatic refresh countdown'
timeout: 5_000,
});
const historyPanel = page.locator('.history-panel');
const completedRow = historyPanel.locator('tr').filter({ hasText: '更新完成' });
await expect(completedRow).toContainText('1.0.0-preview.2');
await expect(completedRow).toContainText('新版本已通过健康检查');
const timelineItem = historyPanel.locator('.update-timeline__item[data-version="1.0.0-preview.2"]');
await expect(timelineItem).toHaveCount(1);
await expect(timelineItem).toContainText('更新完成');
await expect(timelineItem).toContainText('新版本已通过健康检查');
await expect(timelineItem).toContainText('Preview update');
await timelineItem.getByRole('button', { name: '查看完整记录', exact: true }).click();
const historyDialog = page.getByRole('dialog', { name: '更新日志详情' });
await expect(historyDialog).toContainText('获取版本');
await expect(historyDialog).toContainText('下载更新包');
await expect(historyDialog).toContainText('立即更新并重启');
await expect(historyDialog).toContainText('更新完成');
});
test('reloading during installation resumes polling and starts the refresh countdown', async ({ page }) => {