Tighten update center review test coverage

CodeRabbit follow-up review pointed out that one renderer assertion could not fail usefully and that the new recent-candidate deploy test did not prove log streaming after dispatch. The test now asserts the visible candidate text directly and covers streamUpdateCenterTaskLogs for the new deploy path.

Constraint: Keep review follow-up scoped to test coverage only.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:web

Co-authored-by: OmX <omx@oh-my-codex.dev>
This commit is contained in:
cita-777
2026-05-08 10:50:10 +08:00
parent 8309ac073a
commit fee6a6388f
@@ -470,11 +470,7 @@ describe('UpdateCenterSection', () => {
}); });
await flushMicrotasks(); await flushMicrotasks();
const recentTagCard = root.root.find((node) => ( expect(collectText(root.root)).toContain('dev-20260417-f67ade2 @ sha256:bbbbbbbbbbbb');
typeof node.props?.style === 'object'
&& collectText(node).includes('dev-20260417-f67ade2 @ sha256:bbbbbbbbbbbb')
));
expect(recentTagCard).toBeTruthy();
const deployRecentButton = root.root.find((node) => ( const deployRecentButton = root.root.find((node) => (
node.type === 'button' node.type === 'button'
@@ -599,6 +595,7 @@ describe('UpdateCenterSection', () => {
targetTag: 'dev-20260417-next', targetTag: 'dev-20260417-next',
targetDigest: 'sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', targetDigest: 'sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
}); });
expect(apiMock.streamUpdateCenterTaskLogs).toHaveBeenCalledWith('task-1', expect.any(Object));
} finally { } finally {
root?.unmount(); root?.unmount();
} }