unpkg/public/react-dom@16.7.0/cjs/react-dom-test-utils.produc...

34 lines
9.7 KiB
JavaScript

/** @license React v16.7.0
* react-dom-test-utils.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'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 L=[c,e,d,k,f,h],M=0;a=Error(b.replace(/%s/g,function(){return L[M++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
function 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)}
function q(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 r(a){2!==q(a)?p("188"):void 0}
function t(a){var b=a.alternate;if(!b)return b=q(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 r(d),a;if(f===e)return r(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:
p("189")}}c.alternate!==e?p("190"):void 0}3!==c.tag?p("188"):void 0;return c.stateNode.current===c?a:b}function u(){return!0}function v(){return!1}function w(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)?u:v;this.isPropagationStopped=v;return this}
g(w.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=u)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=u)},persist:function(){this.isPersistent=u},isPersistent:v,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=
null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=v;this._dispatchInstances=this._dispatchListeners=null}});w.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};
w.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;x(c);return c};x(w);function y(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 z(a){a instanceof this?void 0:p("279");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}
function x(a){a.eventPool=[];a.getPooled=y;a.release=z}var A=!("undefined"===typeof window||!window.document||!window.document.createElement);function B(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var C={animationend:B("Animation","AnimationEnd"),animationiteration:B("Animation","AnimationIteration"),animationstart:B("Animation","AnimationStart"),transitionend:B("Transition","TransitionEnd")},D={},E={};
A&&(E=document.createElement("div").style,"AnimationEvent"in window||(delete C.animationend.animation,delete C.animationiteration.animation,delete C.animationstart.animation),"TransitionEvent"in window||delete C.transitionend.transition);function F(a){if(D[a])return D[a];if(!C[a])return a;var b=C[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in E)return D[a]=b[c];return a}
var G=F("animationend"),H=F("animationiteration"),I=F("animationstart"),J=F("transitionend"),K=m.findDOMNode,N=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,O=N[0],P=N[4],Q=N[5],R=N[6],S=N[7],aa=N[8],T=N[9],ba=N[10];function U(){}
function ca(a,b){if(!a)return[];a=t(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}}}
function V(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)}}
var 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},isCompositeComponentWithType:function(a,
b){return W.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){V(a,"findAllInRenderedTree");return a?ca(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){V(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"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==
d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){V(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){V(a,"scryRenderedDOMComponentsWithTag");return W.findAllInRenderedTree(a,function(a){return W.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,
b){V(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){V(a,"scryRenderedComponentsWithType");return W.findAllInRenderedTree(a,function(a){return W.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){V(a,"findRenderedComponentWithType");a=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:{}};
function da(a){return function(b,c){l.isValidElement(b)?p("228"):void 0;W.isCompositeComponent(b)?p("229"):void 0;var e=P[a],d=new U;d.target=b;d.type=a.toLowerCase();var k=O(b),f=new w(e,k,d,b);f.persist();g(f,c);e.phasedRegistrationNames?Q(f):R(f);m.unstable_batchedUpdates(function(){S(b);ba(f)});aa()}}W.Simulate={};var X=void 0;for(X in P)W.Simulate[X]=da(X);
function ea(a,b){return function(c,e){var d=new U(a);g(d,e);W.isDOMComponent(c)?(c=K(c),d.target=c,T(b,d)):c.tagName&&(d.target=c,T(b,d))}}
[["abort","abort"],[G,"animationEnd"],[H,"animationIteration"],[I,"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"],
["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"],
["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",
"touchStart"],[J,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];W.SimulateNative[b]=ea(b,a[0])});var Y={default:W},Z=Y&&W||Y;module.exports=Z.default||Z;