Skip to content

Commit 010ac84

Browse files
committed
test(app): simplify multiline question regression checks
1 parent 22e9f30 commit 010ac84

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

‎packages/app/e2e/regression/session-request-docks.spec.ts‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,10 @@ test("replies with predefined choices and a multiline custom answer", async ({ p
151151
await expect(terminal).toBeChecked()
152152

153153
await input.fill("first\nsecond\nthird\nfourth")
154+
await expect(input).toHaveValue("first\nsecond\nthird\nfourth")
154155
await expect.poll(() => input.evaluate((el) => el.scrollHeight - el.clientHeight)).toBeLessThanOrEqual(1)
155-
await expect.poll(() => input.evaluate((el) => el.getBoundingClientRect().height)).toBeGreaterThan(52)
156156
await input.fill(Array.from({ length: 12 }, (_, index) => `line ${index + 1}`).join("\n"))
157157
await expect.poll(() => input.evaluate((el) => el.scrollHeight - el.clientHeight)).toBeGreaterThan(0)
158-
await expect.poll(() => input.evaluate((el) => el.getBoundingClientRect().height)).toBeLessThanOrEqual(124)
159-
expect(
160-
await input.evaluate((el) => {
161-
el.scrollTop = el.scrollHeight
162-
return el.scrollTop
163-
}),
164-
).toBeGreaterThan(0)
165158

166159
await input.fill("")
167160
await expect.poll(() => customRow.evaluate((el) => el.getBoundingClientRect().height)).toBe(40)
@@ -175,14 +168,11 @@ test("replies with predefined choices and a multiline custom answer", async ({ p
175168
await input.dispatchEvent("keydown", { key: "Enter", isComposing: true })
176169
await expect(customRow).toHaveAttribute("data-editing", "true")
177170
await expect(input).toBeFocused()
178-
expect(
179-
await input.evaluate((el) => {
180-
const event = new KeyboardEvent("keydown", { key: "Enter", bubbles: true })
181-
Object.defineProperty(event, "keyCode", { value: 229 })
182-
el.dispatchEvent(event)
183-
return event.keyCode
184-
}),
185-
).toBe(229)
171+
await input.evaluate((el) => {
172+
const event = new KeyboardEvent("keydown", { key: "Enter", bubbles: true })
173+
Object.defineProperty(event, "keyCode", { value: 229 })
174+
el.dispatchEvent(event)
175+
})
186176
await expect(customRow).toHaveAttribute("data-editing", "true")
187177
await expect(input).toBeFocused()
188178
await input.press("Enter")

0 commit comments

Comments
 (0)