Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
isFirefox.mockReturnValue(false)
jest.spyOn(console, 'error')
console.error.mockImplementation(() => {}) // eslint-disable-line no-console
render(`
<form id="blah" method="get" action="/kaki.html">
<input type="text">
<button>asdfsd</button>
<button style="display:none" type="submit">sub</button>
</form>
`)
inputElement = window.document.querySelector('form input')
recorder.attach()
fireEvent.focus(inputElement)
fireEvent.input(inputElement, { target: { value: 'blah' } })
})
function dblClickCheckbox(checkbox) {
fireEvent.mouseOver(checkbox);
fireEvent.mouseMove(checkbox);
fireEvent.mouseDown(checkbox);
fireEvent.focus(checkbox);
fireEvent.mouseUp(checkbox);
fireEvent.click(checkbox);
fireEvent.mouseDown(checkbox);
fireEvent.mouseUp(checkbox);
fireEvent.click(checkbox);
}
function selectOption(select, option) {
fireEvent.mouseOver(option);
fireEvent.mouseMove(option);
fireEvent.mouseDown(option);
fireEvent.focus(option);
fireEvent.mouseUp(option);
fireEvent.click(option);
option.selected = true;
fireEvent.change(select);
}
function clickBooleanElement(element) {
if (element.disabled) return;
fireEvent.mouseOver(element);
fireEvent.mouseMove(element);
fireEvent.mouseDown(element);
fireEvent.focus(element);
fireEvent.mouseUp(element);
fireEvent.click(element);
}
const focus = (input: HTMLElement) => {
fireEvent.focus(input);
fireEvent.keyDown(input, {
key: "ArrowDown",
keyCode: 40,
code: 40
});
};