Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading