Skip to content

Commit e3f20a5

Browse files
committed
test(tui): the unfolded activity group's stub gap rule reads the previous row
1 parent 2ba50dc commit e3f20a5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/tui/test/cli/tui/group-view.test.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,12 @@ test("an unfolded low activity group spaces its rows by the transcript's row gap
338338
// The second call draws nothing, as a plugin's call row folded into the one before it does.
339339
entry: (entry) =>
340340
entry.type === "part" && entry.ref.partID !== "two" ? <text>Shell {entry.ref.partID}</text> : null,
341-
// Tight under the group's row and after the first call, one blank row above the third.
342-
gap: (entry) => (entry.type === "part" && entry.ref.partID === "three" ? 1 : 0),
341+
// Prime's rule in small: a row after the group's own row or after a call stacks tight; any other
342+
// previous row (none, a message) gets a blank row. The third call asks for one blank row above it.
343+
gap: (entry, previous) => {
344+
if (entry.type === "part" && entry.ref.partID === "three") return 1
345+
return previous?.type === "group" || previous?.type === "part" ? 0 : 1
346+
},
343347
})
344348
try {
345349
app.renderer.start()
@@ -349,6 +353,7 @@ test("an unfolded low activity group spaces its rows by the transcript's row gap
349353
.split("\n")
350354
.map((line) => line.trim())
351355
const start = lines.findIndex((line) => line.startsWith("− 3 commands"))
356+
// The owner's layout: the first call on the row right under the group's own row, no blank row between.
352357
expect(lines.slice(start, start + 4)).toEqual(["− 3 commands", "Shell one", "", "Shell three"])
353358
} finally {
354359
app.renderer.destroy()

0 commit comments

Comments
 (0)