Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion sdk/typescript/src/scan-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ export class ScanDashboard {
const files =
this.#files === null
? "waiting for inventory"
: `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed`;
: this.#files.filesCompleted > 0
? `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed`
: `${formatCount(this.#files.filesTotal)} in scope`;
const tokens =
this.#cost === null
? "waiting for usage"
Expand Down
9 changes: 8 additions & 1 deletion sdk/typescript/tests-ts/scan-dashboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ describe("live scan dashboard", () => {
output_tokens: 236,
}).cost!,
);
dashboard.setFiles({
phase: "discovery",
filesCompleted: 3,
filesTotal: 1_258,
});
dashboard.stop();

const text = stripVTControlCharacters(stderr.text());
Expand All @@ -290,7 +295,9 @@ describe("live scan dashboard", () => {
expect(text).toContain(" routes/login.ts");
expect(text).not.toContain("[09:41:19] routes/login.ts");
expect(text).toContain("routes/login.ts");
expect(text).toContain("0 / 1,258 reviewed");
expect(text).toContain("1,258 in scope");
expect(text).not.toContain("0 / 1,258 reviewed");
expect(text).toContain("3 / 1,258 reviewed");
expect(text).not.toContain("opened");
expect(text).not.toContain("3 / 6 active");
expect(text).toContain("17,985 in · 10,496 cached · 236 out");
Expand Down
Loading