Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("handles input value longer than 2 chars correctly when using buttons", () => {
const { container } = renderQtySelectorComponent();
const input = container.getElementsByTagName("input")[0];
const button = container.getElementsByTagName("button")[1];
Simulate.change(input, {
target: { value: "99" }
});
Simulate.click(button);
expect(container.firstChild).toMatchSnapshot();
});
Object.keys(formData).forEach((fieldId, i) => {
const field = getter(fieldId)
field.value = formData[fieldId]
Simulate.change(field)
})
const { getByText, container } = renderIntoDocument(
)
const form = container.querySelector('form')
const submitButton = getByText('Search for domain')
const domainName = form.querySelector('input[type=text]')
//act
domainName.value = 'vitalik.eth'
Simulate.change(domainName)
submitButton.click()
//assert
expect(handleGetNodeDetails).toHaveBeenCalledTimes(1)
//expect(handleGetNodeDetails).toHaveBeenCalledWith('vitalik.eth', mockClient, addNotification)
expect(submitButton.type).toBe('submit')
expect(domainName.value).toBe('')
})