Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / coverage / lcov-report / new-forms / OneForm / renderInput.tsx.html
Size: Mime:
<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for new-forms/OneForm/renderInput.tsx</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../prettify.css" />
    <link rel="stylesheet" href="../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../index.html">All files</a> / <a href="index.html">new-forms/OneForm</a> renderInput.tsx
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">87.5% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>21/24</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">70% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>7/10</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">100% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>3/3</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">86.36% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>19/22</span>
      </div>
    </div>
  </div>
  <div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">356x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import * as React from 'react'
import { isFunction, isObj } from 'exotic'
import { ObserverInput, InputState } from '../inputs'
import { PluginsContext, InputPluginType } from '../plugins/PluginsContext'
&nbsp;
/**
 * @alias renderInputFromPluginContext
 * @todo @@perf
 */
export const renderInput = (inputState: InputState, index?: number) =&gt; (
  &lt;PluginsContext.Consumer key={inputState.identifier + index + '-consumer'}&gt;
    <span class="missing-if-branch" title="else path not taken" >E</span>{plugins =&gt; {
      if<span class="missing-if-branch" title="if path not taken" >I</span> (process.env.NODE_ENV !== 'production') {
        if (<span class="cstat-no" title="statement not covered" >Array.isArray(plugins) === false) {</span>
          throw new TypeError(
            'PluginsContext.Provider was not used - use it to provide the plugins used to render a form'
          )
    <span class="missing-if-branch" title="else path not taken" >E</span>    }
      }
&nbsp;
      const isSatisfiedBy = (Plugin: InputPluginType) =&gt;
        Plugin.isSatisfiedByProps(inputState)
&nbsp;
      if (plugins.some(isSatisfiedBy)) {
        // console.debug('[renderInput]')
        const Found = plugins.find(isSatisfiedBy) as InputPluginType
&nbsp;
        /**
         * @todo this may cause updates when rendering...
         *       need to only `find` it once
         */
        if (isFunction(Found.defaultState)) {
          console.debug('[1form]:renderInput had defaultState - fn')
          inputState.merge(Found.defaultState(inputState))
        } else if (isObj(Found.defaultState)) {
          console.debug('[1form]:renderInput had defaultState - obj')
          inputState.merge(Found.defaultState)
        } else {
          console.debug('[1form]:renderInput had no defaultProps')
<span class="cstat-no" title="statement not covered" >        }</span>
<span class="cstat-no" title="statement not covered" ></span>
        // @todo why this type no like
        return &lt;Found state={inputState} key={inputState.identifier + index} /&gt;
      } else {
        console.error('[1form]:renderInput did not find plugin')
        return (
          &lt;ObserverInput
            state={inputState}
            key={inputState.identifier + index}
          /&gt;
        )
      }
    }}
  &lt;/PluginsContext.Consumer&gt;
)
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sat Nov 10 2018 05:28:54 GMT-0800 (Pacific Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>