From 930c2e7afa1ac6044644a1a2d364ca45da01b91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Sat, 19 Sep 2026 09:16:36 +0200 Subject: [PATCH] test(mobile): assert the Details list labels the completion timestamp https://github.com/Kilo-Org/cloud/pull/6346 --- .../review-detail-screen.mounted.test.tsx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/apps/mobile/src/components/code-reviewer/review-detail-screen.mounted.test.tsx b/apps/mobile/src/components/code-reviewer/review-detail-screen.mounted.test.tsx index 29d2855d79..d7043257aa 100644 --- a/apps/mobile/src/components/code-reviewer/review-detail-screen.mounted.test.tsx +++ b/apps/mobile/src/components/code-reviewer/review-detail-screen.mounted.test.tsx @@ -398,6 +398,39 @@ describe('ReviewDetailScreen outcome-first order', () => { }); }); +describe('ReviewDetailScreen details metadata', () => { + it('labels the completion-timestamp row in the Details list', () => { + // The Details key-value list pairs every label with its value. The + // completion row must render the "Completed" label ahead of its timestamp + // value; a value-only row there would collapse the two-column alignment. + detail.data = { + success: true, + review: makeReview({ + status: 'completed', + started_at: null, + completed_at: '2024-01-01T00:05:00.000Z', + }), + tokenUsage: { input: 0, output: 0 }, + }; + + const texts = renderScreen(); + + // `timeAgo` is mocked to "now" in this suite, so the Details completion row + // is the only "Completed" immediately followed by "now": the status + // conclusion is followed by "Findings" and the Gate status value by its + // "Threshold" row. + const completionRowIndex = texts.findIndex( + (text, index) => text === 'Completed' && texts[index + 1] === 'now' + ); + const detailsHeaderIndex = texts.indexOf('Details'); + // Assert the header was found before comparing: `indexOf` returns -1 on a + // copy change, and `completionRowIndex >= 0` would then satisfy the + // placement check without proving the row sits inside the Details list. + expect(detailsHeaderIndex).toBeGreaterThanOrEqual(0); + expect(completionRowIndex).toBeGreaterThan(detailsHeaderIndex); + }); +}); + describe('ReviewDetailScreen empty council', () => { it('renders "No findings" for a null council result (not a success checkmark)', () => { detail.data = {