Fix chat input resize test by waiting for animation frame
The test was checking the height of the textarea immediately after filling
it with content, but the component uses requestAnimationFrame() to adjust
the height asynchronously. Added a wait for the animation frame to complete
before checking the height.
Co-Authored-By: sketch
diff --git a/loop/webui/src/web-components/sketch-chat-input.test.ts b/loop/webui/src/web-components/sketch-chat-input.test.ts
index a727c50..bcd9f8e 100644
--- a/loop/webui/src/web-components/sketch-chat-input.test.ts
+++ b/loop/webui/src/web-components/sketch-chat-input.test.ts
@@ -154,6 +154,9 @@
// Enter very tall text in the textarea
await component.locator("#chatInput").fill(testContent);
+ // Wait for the requestAnimationFrame to complete
+ await component.evaluate(() => new Promise(requestAnimationFrame));
+
// Check that textarea resized
const newHeight = await component.evaluate(
(el: SketchChatInput) => el.chatInput.style.height,