|
|
@@ -62,18 +62,15 @@ test.sequential("erase screen (content overflows viewport)", async () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential(
|
|
|
|
test.sequential("erase screen where <Static> exists but interactive part is taller than viewport", async () => {
|
|
|
|
"erase screen where <Static> exists but interactive part is taller than viewport",
|
|
|
|
const ps = term("erase", ["3"]);
|
|
|
|
async () => {
|
|
|
|
await ps.waitForExit();
|
|
|
|
const ps = term("erase", ["3"]);
|
|
|
|
expect(ps.output).toContain(ansiEscapes.clearTerminal);
|
|
|
|
await ps.waitForExit();
|
|
|
|
|
|
|
|
expect(ps.output).toContain(ansiEscapes.clearTerminal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const letter of ["A", "B", "C"]) {
|
|
|
|
for (const letter of ["A", "B", "C"]) {
|
|
|
|
expect(ps.output).toContain(letter);
|
|
|
|
expect(ps.output).toContain(letter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential("erase screen where state changes", async () => {
|
|
|
|
test.sequential("erase screen where state changes", async () => {
|
|
|
|
const ps = term("erase-with-state-change", ["4"]);
|
|
|
|
const ps = term("erase-with-state-change", ["4"]);
|
|
|
@@ -132,28 +129,26 @@ test.sequential("fullscreen mode should not add extra newline at the bottom", as
|
|
|
|
expect(lines[4]).toContain("Bottom line");
|
|
|
|
expect(lines[4]).toContain("Bottom line");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential(
|
|
|
|
test.sequential("#442: full terminal-size box should not add an extra scroll line", async () => {
|
|
|
|
"#442: full terminal-size box should not add an extra scroll line",
|
|
|
|
const rows = 5;
|
|
|
|
async () => {
|
|
|
|
const ps = term("issue-442-full-height", [String(rows)]);
|
|
|
|
const rows = 5;
|
|
|
|
await ps.waitForExit();
|
|
|
|
const ps = term("issue-442-full-height", [String(rows)]);
|
|
|
|
|
|
|
|
await ps.waitForExit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const lastFrame = ps.output.split(ansiEscapes.clearTerminal).at(-1) ?? "";
|
|
|
|
const lastFrame = ps.output.split(ansiEscapes.clearTerminal).at(-1) ?? "";
|
|
|
|
const lastFrameContent = stripAnsi(lastFrame);
|
|
|
|
const lastFrameContent = stripAnsi(lastFrame);
|
|
|
|
const lines = lastFrameContent.split("\n");
|
|
|
|
const lines = lastFrameContent.split("\n");
|
|
|
|
|
|
|
|
|
|
|
|
expect(lastFrameContent).not.toMatch(/\n$/);
|
|
|
|
expect(lastFrameContent).not.toMatch(/\n$/);
|
|
|
|
expect(lines).toHaveLength(rows);
|
|
|
|
expect(lines).toHaveLength(rows);
|
|
|
|
expect(lines.at(-1)).toContain("#442 bottom");
|
|
|
|
expect(lines.at(-1)).toContain("#442 bottom");
|
|
|
|
},
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ── Issue #450 tests ────────────────────────────────────────────────
|
|
|
|
// ── Issue #450 tests ────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential("#450: full-height rerenders should not repeatedly clear terminal", async () => {
|
|
|
|
test.sequential("#450: full-height rerenders should not repeatedly clear terminal", async () => {
|
|
|
|
const { output, clearTerminalCount, eraseLineCount } =
|
|
|
|
const { output, clearTerminalCount, eraseLineCount } = await runIssue450FixtureWithCounts(
|
|
|
|
await runIssue450FixtureWithCounts("issue-450-full-height-rerender");
|
|
|
|
"issue-450-full-height-rerender",
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
expect(output).toContain("frame 8");
|
|
|
|
expect(output).toContain("frame 8");
|
|
|
|
expect(clearTerminalCount).toBeLessThanOrEqual(1);
|
|
|
|
expect(clearTerminalCount).toBeLessThanOrEqual(1);
|
|
|
@@ -182,32 +177,26 @@ test.sequential("#450: initial full-height frame should not clear terminal", asy
|
|
|
|
expect(outputBeforeMarker).not.toContain(ansiEscapes.clearTerminal);
|
|
|
|
expect(outputBeforeMarker).not.toContain(ansiEscapes.clearTerminal);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential(
|
|
|
|
test.sequential("#450: grow from rows - 1 to full-height should not clear before unmount", async () => {
|
|
|
|
"#450: grow from rows - 1 to full-height should not clear before unmount",
|
|
|
|
const renderedMarker = "__GROW_TO_FULLSCREEN_RERENDER_COMPLETED__";
|
|
|
|
async () => {
|
|
|
|
const outputBeforeMarker = await runIssue450FixtureBeforeMarker(
|
|
|
|
const renderedMarker = "__GROW_TO_FULLSCREEN_RERENDER_COMPLETED__";
|
|
|
|
"issue-450-grow-to-fullscreen-rerender",
|
|
|
|
const outputBeforeMarker = await runIssue450FixtureBeforeMarker(
|
|
|
|
renderedMarker,
|
|
|
|
"issue-450-grow-to-fullscreen-rerender",
|
|
|
|
);
|
|
|
|
renderedMarker,
|
|
|
|
const { clearTerminalCount } = getIssue450ControlSequenceCounts(outputBeforeMarker);
|
|
|
|
);
|
|
|
|
|
|
|
|
const { clearTerminalCount } = getIssue450ControlSequenceCounts(outputBeforeMarker);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(outputBeforeMarker).toContain("frame 8");
|
|
|
|
expect(outputBeforeMarker).toContain("frame 8");
|
|
|
|
expect(clearTerminalCount).toBe(0);
|
|
|
|
expect(clearTerminalCount).toBe(0);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test.sequential(
|
|
|
|
test.sequential("#450: shrink from full-height to rows - 1 should clear exactly once", async () => {
|
|
|
|
"#450: shrink from full-height to rows - 1 should clear exactly once",
|
|
|
|
const { output, clearTerminalCount } = await runIssue450FixtureWithCounts(
|
|
|
|
async () => {
|
|
|
|
"issue-450-shrink-from-fullscreen-rerender",
|
|
|
|
const { output, clearTerminalCount } = await runIssue450FixtureWithCounts(
|
|
|
|
);
|
|
|
|
"issue-450-shrink-from-fullscreen-rerender",
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(output).toContain("frame 8");
|
|
|
|
expect(output).toContain("frame 8");
|
|
|
|
expect(clearTerminalCount).toBe(1);
|
|
|
|
expect(clearTerminalCount).toBe(1);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ── Animation exit tests ────────────────────────────────────────────
|
|
|
|
// ── Animation exit tests ────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|