This commit is contained in:
@@ -138,8 +138,12 @@ async function installFixture(
|
||||
beforeJson: null,
|
||||
afterJson: JSON.stringify({
|
||||
targetVersion,
|
||||
...(actionCode === 'SYSTEM_UPDATE_CHECK' ? { releaseNotes: 'Preview update' } : {}),
|
||||
...(actionCode === 'SYSTEM_UPDATE_SUCCEEDED' ? { state: 'SUCCEEDED' } : {}),
|
||||
...(actionCode === 'SYSTEM_UPDATE_CHECK'
|
||||
? { releaseNotes: 'Preview update', publishedAt: '2026-08-16T00:00:00Z' }
|
||||
: {}),
|
||||
...(actionCode === 'SYSTEM_UPDATE_SUCCEEDED'
|
||||
? { state: 'SUCCEEDED', releaseNotes: 'Preview update', publishedAt: '2026-08-16T00:00:00Z' }
|
||||
: {}),
|
||||
}),
|
||||
occurredAt: '2026-08-16T00:02:00Z',
|
||||
allowedActions: [],
|
||||
@@ -214,6 +218,7 @@ async function installFixture(
|
||||
const query = new URL(request.url()).searchParams;
|
||||
expect(query.get('occurredFrom')).toBe('1970-01-01T00:00:00Z');
|
||||
expect(query.get('objectType')).toBe('SYSTEM_UPDATE');
|
||||
expect(query.get('size')).toBe('100');
|
||||
return route.fulfill({
|
||||
json: {
|
||||
data: history,
|
||||
@@ -418,15 +423,18 @@ test('successful installation starts the ten-second automatic refresh countdown'
|
||||
const historyPanel = page.locator('.history-panel');
|
||||
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('新版本已通过健康检查');
|
||||
await expect(timelineItem).toContainText('Preview update');
|
||||
await timelineItem.getByRole('button', { name: '查看完整记录', exact: true }).click();
|
||||
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('更新完成');
|
||||
await expect(historyDialog).toContainText('更新日志');
|
||||
await expect(historyDialog).toContainText('Preview update');
|
||||
await expect(historyDialog).toContainText('发布时间');
|
||||
await expect(historyDialog.locator('.history-detail__steps')).toHaveCount(0);
|
||||
await expect(historyDialog).not.toContainText('获取版本');
|
||||
await expect(historyDialog).not.toContainText('下载更新包');
|
||||
await expect(historyDialog).not.toContainText('立即更新并重启');
|
||||
});
|
||||
|
||||
test('reloading during installation resumes polling and starts the refresh countdown', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user