In my case userEvent.type(input, "abc{enter}");
didn't work because I need to modify and validate the value before submitting it. This worked.
test("should submit when pressing enter", async () => {
const handleSubmit = jest.fn();
const { getByLabelText } = render(<App handleSubmit={handleSubmit} />);
const input = getByLabelText("Name:");
fireEvent.change(input, { target: { value: "abc" } });
await userEvent.type(input, '{enter}');
expect(handleSubmit).toHaveBeenCalled();
});