Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {