update chat input tests to expect new behaviour (#1443)

This commit is contained in:
sp.wack 2024-04-29 17:37:33 +03:00 committed by GitHub
parent 319b9ac0f3
commit c02b681728
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -27,7 +27,16 @@ describe("ChatInput", () => {
<ChatInput disabled onSendMessage={onSendMessage} />,
);
const textarea = getByRole("textbox");
expect(textarea).toBeDisabled();
const button = getByRole("button");
expect(textarea).not.toBeDisabled(); // user can still type
expect(button).toBeDisabled(); // user cannot submit
act(() => {
userEvent.type(textarea, "Hello, world!{enter}");
});
expect(onSendMessage).not.toHaveBeenCalled();
});
// Note that this test only checks that the placeholder is rendered, not the actual value

6
package-lock.json generated Normal file
View File

@ -0,0 +1,6 @@
{
"name": "OpenDevin",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}