UNPKG

10.3 kBJavaScriptView Raw
1/** @license React v16.8.6
2 * react-dom-test-utils.production.min.js
3 *
4 * Copyright (c) Facebook, Inc. and its affiliates.
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the root directory of this source tree.
8 */
9
10'use strict';var g=require("object-assign"),l=require("react"),m=require("react-dom");function n(a,b,c,e,d,k,f,h){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var N=[c,e,d,k,f,h],O=0;a=Error(b.replace(/%s/g,function(){return N[O++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
11function p(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;e<b;e++)c+="&args[]="+encodeURIComponent(arguments[e+1]);n(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",c)}var q=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;q.hasOwnProperty("ReactCurrentDispatcher")||(q.ReactCurrentDispatcher={current:null});
12function r(a){var b=a;if(a.alternate)for(;b.return;)b=b.return;else{if(0!==(b.effectTag&2))return 1;for(;b.return;)if(b=b.return,0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function t(a){2!==r(a)?p("188"):void 0}
13function u(a){var b=a.alternate;if(!b)return b=r(a),3===b?p("188"):void 0,1===b?null:a;for(var c=a,e=b;;){var d=c.return,k=d?d.alternate:null;if(!d||!k)break;if(d.child===k.child){for(var f=d.child;f;){if(f===c)return t(d),a;if(f===e)return t(d),b;f=f.sibling}p("188")}if(c.return!==e.return)c=d,e=k;else{f=!1;for(var h=d.child;h;){if(h===c){f=!0;c=d;e=k;break}if(h===e){f=!0;e=d;c=k;break}h=h.sibling}if(!f){for(h=k.child;h;){if(h===c){f=!0;c=k;e=d;break}if(h===e){f=!0;e=k;c=d;break}h=h.sibling}f?void 0:
14p("189")}}c.alternate!==e?p("190"):void 0}3!==c.tag?p("188"):void 0;return c.stateNode.current===c?a:b}function v(){return!0}function w(){return!1}function x(a,b,c,e){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=e:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?v:w;this.isPropagationStopped=w;return this}
15g(x.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=v)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=v)},persist:function(){this.isPersistent=v},isPersistent:w,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=
16null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=w;this._dispatchInstances=this._dispatchListeners=null}});x.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
17x.extend=function(a){function b(){}function c(){return e.apply(this,arguments)}var e=this;b.prototype=e.prototype;var d=new b;g(d,c.prototype);c.prototype=d;c.prototype.constructor=c;c.Interface=g({},e.Interface,a);c.extend=e.extend;y(c);return c};y(x);function z(a,b,c,e){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,e);return d}return new this(a,b,c,e)}function A(a){a instanceof this?void 0:p("279");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}
18function y(a){a.eventPool=[];a.getPooled=z;a.release=A}var B=!("undefined"===typeof window||!window.document||!window.document.createElement);function C(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var D={animationend:C("Animation","AnimationEnd"),animationiteration:C("Animation","AnimationIteration"),animationstart:C("Animation","AnimationStart"),transitionend:C("Transition","TransitionEnd")},E={},F={};
19B&&(F=document.createElement("div").style,"AnimationEvent"in window||(delete D.animationend.animation,delete D.animationiteration.animation,delete D.animationstart.animation),"TransitionEvent"in window||delete D.transitionend.transition);function G(a){if(E[a])return E[a];if(!D[a])return a;var b=D[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in F)return E[a]=b[c];return a}
20var H=G("animationend"),I=G("animationiteration"),J=G("animationstart"),K=G("transitionend"),L=m.findDOMNode,M=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,P=M[0],Q=M[4],R=M[5],aa=M[6],ba=M[7],ca=M[8],S=M[9],da=M[10];function T(){}
21function ea(a,b){if(!a)return[];a=u(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}}
22function U(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;p("286",b,a)}}
23var V=null,W={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return l.isValidElement(a)},isElementOfType:function(a,b){return l.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&l.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return W.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},
24isCompositeComponentWithType:function(a,b){return W.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){U(a,"findAllInRenderedTree");return a?ea(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){U(a,"scryRenderedDOMComponentsWithClass");return W.findAllInRenderedTree(a,function(a){if(W.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?p("11"):
25void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){U(a,"findRenderedDOMComponentWithClass");a=W.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){U(a,"scryRenderedDOMComponentsWithTag");return W.findAllInRenderedTree(a,function(a){return W.isDOMComponent(a)&&a.tagName.toUpperCase()===
26b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){U(a,"findRenderedDOMComponentWithTag");a=W.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){U(a,"scryRenderedComponentsWithType");return W.findAllInRenderedTree(a,function(a){return W.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){U(a,"findRenderedComponentWithType");
27a=W.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return l.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){null===V&&(V=document.createElement("div"));m.unstable_batchedUpdates(a);
28m.render(l.createElement("div",null),V);return{then:function(){}}}};function fa(a){return function(b,c){l.isValidElement(b)?p("228"):void 0;W.isCompositeComponent(b)?p("229"):void 0;var e=Q[a],d=new T;d.target=b;d.type=a.toLowerCase();var k=P(b),f=new x(e,k,d,b);f.persist();g(f,c);e.phasedRegistrationNames?R(f):aa(f);m.unstable_batchedUpdates(function(){ba(b);da(f)});ca()}}W.Simulate={};var X=void 0;for(X in Q)W.Simulate[X]=fa(X);
29function ha(a,b){return function(c,e){var d=new T(a);g(d,e);W.isDOMComponent(c)?(c=L(c),d.target=c,S(b,d)):c.tagName&&(d.target=c,S(b,d))}}
30[["abort","abort"],[H,"animationEnd"],[I,"animationIteration"],[J,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"],
31["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"],
32["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart",
33"touchStart"],[K,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];W.SimulateNative[b]=ha(b,a[0])});var Y={default:W},Z=Y&&W||Y;module.exports=Z.default||Z;