How to use the @testing-library/dom.fireEvent function in @testing-library/dom

To help you get started, we’ve selected a few @testing-library/dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github testing-library / vue-testing-library / src / vue-testing-library.js View on Github external
async function fireEvent(...args) {
  dtlFireEvent(...args)
  await wait()
}
github testing-library / svelte-testing-library / src / pure.js View on Github external
const fireEvent = async (...args) => {
  const event = dtlFireEvent(...args)
  await tick()
  return event
}
github testing-library / preact-testing-library / src / pure.js View on Github external
preactAct(() => {
    returnValue = dtl.fireEvent(...args)
  })
github testing-library / react-testing-library / src / pure.js View on Github external
act(() => {
    returnValue = dtlFireEvent(...args)
  })
  return returnValue
github gitlabhq / gitlabhq / spec / frontend / pipelines / graph_shared / links_layer_spec.js View on Github external
it('shows links when override is clicked', async () => {
        expect(findLinksInner().exists()).toBe(false);
        fireEvent(findShowAnyways(), new MouseEvent('click', { bubbles: true }));
        await wrapper.vm.$nextTick();
        expect(findLinksInner().exists()).toBe(true);
      });
    });
github jamaljsr / polar / src / components / designer / default / DefaultSidebar.spec.tsx View on Github external
it('should allow dragging a node', async () => {
    const { getByText } = renderComponent();
    const lnd = getByText(`LND v${LndVersion.latest}`);
    const setData = jest.fn();
    const dragEvent = createEvent.dragStart(lnd);
    Object.defineProperty(dragEvent, 'dataTransfer', { value: { setData } });
    fireEvent(lnd, dragEvent);
    expect(setData).toBeCalledWith(
      REACT_FLOW_CHART,
      JSON.stringify({ type: 'lnd', version: LndVersion.latest }),
    );
  });
github ifiokjr / remirror / packages / jest-prosemirror / src / jest-prosemirror-editor.ts View on Github external
  syntheticEvents.forEach(syntheticEvent => fireEvent(element, syntheticEvent));