Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
expect(getByTestId("input")).not.toHaveProperty("value", text);
for (let i = 0; i < text.length; i++) {
jest.advanceTimersByTime(delay);
await wait(() => expect(input).toHaveBeenCalledTimes(i + 1));
expect(getByTestId("input")).toHaveProperty(
"value",
text.slice(0, i + 1)
);
}
// Vue's change event is not emitted until blurring the input
expect(change).not.toHaveBeenCalled();
fireEvent.blur(getByTestId("input"));
await wait(() => expect(change).toHaveBeenCalledTimes(1));
});