How to use the enzyme-adapter-utils.mapNativeEventNames function in enzyme-adapter-utils

To help you get started, we’ve selected a few enzyme-adapter-utils 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 skbkontur / react-ui-tour / testsSetup / ReactSixteenAdapter.ts View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(
            `ReactWrapper::simulate() event '${event}' does not exist`
          );
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(nodeToHostNode(node), mock);
      },
      batchedUpdates(fn) {
github unsplash / react-progressive-enhancement / tests / ReactSixteenAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(
            `ReactWrapper::simulate() event '${event}' does not exist`,
          );
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(nodeToHostNode(node), mock);
      },
      batchedUpdates(fn) {
github drcmda / react-contextual / tests / jest.react.16.adapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event)
        const eventFn = TestUtils.Simulate[mappedEvent]
        if (!eventFn) {
          throw new TypeError(
            `ReactWrapper::simulate() event '${event}' does not exist`
          )
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(nodeToHostNode(node), mock)
      },
      batchedUpdates(fn) {
github airbnb / enzyme / packages / enzyme-adapter-react-14 / src / ReactFourteenAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(ReactDOM.findDOMNode(node.instance), mock);
      },
      batchedUpdates(fn) {
github zerobias / effector / src / fixtures / ReactSixteenAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event)
        const eventFn = TestUtils.Simulate[mappedEvent]
        if (!eventFn) {
          throw new TypeError(
            `ReactWrapper::simulate() event '${event}' does not exist`,
          )
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(nodeToHostNode(node), mock)
      },
      batchedUpdates(fn) {
github airbnb / enzyme / packages / enzyme-adapter-react-15 / src / ReactFifteenAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event, { animation: true });
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(ReactDOM.findDOMNode(node.instance), mock);
      },
      batchedUpdates(fn) {
github airbnb / enzyme / packages / enzyme-adapter-react-15 / src / ReactFifteenAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event, eventOptions);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(ReactDOM.findDOMNode(node.instance), mock);
      },
      batchedUpdates(fn) {
github airbnb / enzyme / packages / enzyme-adapter-react-15.4 / src / ReactFifteenFourAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event, { animation: true });
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(ReactDOM.findDOMNode(node.instance), mock);
      },
      batchedUpdates(fn) {
github airbnb / enzyme / packages / enzyme-adapter-react-16.3 / src / ReactSixteenThreeAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event, eventOptions);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        // eslint-disable-next-line react/no-find-dom-node
        eventFn(adapter.nodeToHostNode(node), mock);
      },
      batchedUpdates(fn) {
github aweary / enzyme-adapter-preact / src / PreactAdapter.js View on Github external
simulateEvent(node, event, mock) {
        const mappedEvent = mapNativeEventNames(event);
        const eventFn = TestUtils.Simulate[mappedEvent];
        if (!eventFn) {
          throw new TypeError(`ReactWrapper::simulate() event '${event}' does not exist`);
        }
        eventFn(node.instance && node.instance.base || node.instance, mock);
      },
      batchedUpdates(fn) {