Skip to content

Commit e7c5848

Browse files
committed
test(repl): read the new History rows in wheel tests
1 parent 55bd9a9 commit e7c5848

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎packages/cli/tests/repl-wheel-burst.test.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,20 @@ describe("wheel bursts in one input chunk", () => {
9696
expect(page.screen().found("[History]")).toBe(1);
9797
expect(page.screen().shows("[exit]")).toBe(true);
9898
yield* page.press("[History]");
99-
yield* page.until("History opens", (one) => one.shows("120:"));
100-
expect(page.screen().shows("120:")).toBe(true);
99+
yield* page.until("History opens", (one) => one.shows("in 120 "));
100+
expect(page.screen().shows("in 120 ")).toBe(true);
101101
yield* page.key("Escape");
102-
yield* page.until("History closes", (one) => !one.shows("120:"));
102+
yield* page.until("History closes", (one) => !one.shows("in 120 "));
103103
yield* page.until("History focus restored", (one) => one.shows("> [History]"));
104104
for (let stop = 0; stop < 30 && !page.screen().shows("> [History]"); stop++) {
105105
yield* page.key("Tab");
106106
yield* sleep(30);
107107
}
108108
expect(page.screen().shows("> [History]")).toBe(true);
109109
yield* page.key("Enter");
110-
yield* page.until("keyboard History opens", (one) => one.shows("120:"));
110+
yield* page.until("keyboard History opens", (one) => one.shows("in 120 "));
111111
yield* page.key("Escape");
112-
yield* page.until("keyboard History closes", (one) => !one.shows("120:"));
112+
yield* page.until("keyboard History closes", (one) => !one.shows("in 120 "));
113113
}
114114
});
115115

@@ -120,11 +120,13 @@ describe("wheel bursts in one input chunk", () => {
120120
yield* page.until("History", (one) => one.shows("[close]"));
121121
yield* page.key("Tab");
122122
yield* page.until("History actions own focus", (one) => one.shows("> [close]"));
123-
const cell = page.screen().locate("30:");
123+
const cell = page.screen().locate("in 30 ");
124124
const positions = () =>
125125
page
126126
.screen()
127-
.rows.flatMap((row) => [...row.matchAll(/(?:^|\s)(\d+):/g)].map((match) => match[1]));
127+
.rows.flatMap((row) =>
128+
[...row.matchAll(/(?:^|\s)in +(\d+)(?=\s|$)/g)].map((match) => match[1]),
129+
);
128130
const newest = positions();
129131
yield* burst(page, "down", cell, 4);
130132
const older = positions();

0 commit comments

Comments
 (0)