Skip to content

Commit 3d2b239

Browse files
author
bgagent
committed
test(cli): cover artifact_uri render lines (#248 Phase 3)
The Artifact: display lines added to formatTaskDetail / formatStatusSnapshot introduced uncovered truthy branches that dropped CLI branch coverage below the 84% gate (full `mise run build` caught it; the per-package run had passed on the prior content). Adds non-null + null cases for both renderers, mirroring the existing trace_s3_uri tests. cli 300 passed; full build green.
1 parent 292019f commit 3d2b239

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

cli/test/format-status-snapshot.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,18 @@ describe('formatStatusSnapshot', () => {
315315
expect(rendered).not.toContain('Trace S3:');
316316
});
317317

318+
test('renders Artifact line when artifact_uri is non-null (#248 Phase 3)', () => {
319+
const task = buildTask({ artifact_uri: 's3://artifacts-bkt/artifacts/abc123/result.md' });
320+
const rendered = formatStatusSnapshot(task, [], NOW);
321+
expect(rendered).toContain('Artifact: s3://artifacts-bkt/artifacts/abc123/result.md');
322+
});
323+
324+
test('omits Artifact line when artifact_uri is null', () => {
325+
const task = buildTask();
326+
const rendered = formatStatusSnapshot(task, [], NOW);
327+
expect(rendered).not.toContain('Artifact:');
328+
});
329+
318330
// ---- Workflow + Reason (PR #52 CLI UX carry-forward) ----
319331

320332
test('renders Workflow line for pr_iteration tasks with PR number', () => {

cli/test/format.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ describe('format', () => {
142142
expect(output).not.toContain('Trace S3:');
143143
});
144144

145+
test('renders Artifact line when artifact_uri is non-null (#248 Phase 3)', () => {
146+
const withArtifact: TaskDetail = {
147+
...task,
148+
artifact_uri: 's3://artifacts-bkt/artifacts/abc123/result.md',
149+
};
150+
const output = formatTaskDetail(withArtifact);
151+
expect(output).toContain('Artifact: s3://artifacts-bkt/artifacts/abc123/result.md');
152+
});
153+
154+
test('omits Artifact line when artifact_uri is null', () => {
155+
const output = formatTaskDetail(task);
156+
expect(output).not.toContain('Artifact:');
157+
});
158+
145159
test('shows classified error with raw detail when error_classification is present', () => {
146160
const failedTask: TaskDetail = {
147161
...task,

0 commit comments

Comments
 (0)