Skip to content

Commit

Permalink
v0.0.1 test: add useFrame test case. 6809191
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 5, 2023
1 parent 8fc7142 commit 4ab9196
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 165 deletions.
10 changes: 5 additions & 5 deletions badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions coverage/coverage-summary.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"total": {"lines":{"total":46,"covered":42,"skipped":0,"pct":91.3},"statements":{"total":51,"covered":44,"skipped":0,"pct":86.27},"functions":{"total":12,"covered":9,"skipped":0,"pct":75},"branches":{"total":34,"covered":26,"skipped":0,"pct":76.47},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
,"/home/runner/work/react-iframe/react-iframe/core/src/Context.tsx": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":7,"covered":6,"skipped":0,"pct":85.71},"branches":{"total":4,"covered":2,"skipped":0,"pct":50}}
,"/home/runner/work/react-iframe/react-iframe/core/src/index.tsx": {"lines":{"total":40,"covered":36,"skipped":0,"pct":90},"functions":{"total":11,"covered":9,"skipped":0,"pct":81.81},"statements":{"total":44,"covered":38,"skipped":0,"pct":86.36},"branches":{"total":30,"covered":24,"skipped":0,"pct":80}}
{"total": {"lines":{"total":46,"covered":45,"skipped":0,"pct":97.82},"statements":{"total":51,"covered":49,"skipped":0,"pct":96.07},"functions":{"total":12,"covered":11,"skipped":0,"pct":91.66},"branches":{"total":34,"covered":28,"skipped":0,"pct":82.35},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
,"/home/runner/work/react-iframe/react-iframe/core/src/Context.tsx": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":4,"covered":2,"skipped":0,"pct":50}}
,"/home/runner/work/react-iframe/react-iframe/core/src/index.tsx": {"lines":{"total":40,"covered":39,"skipped":0,"pct":97.5},"functions":{"total":11,"covered":10,"skipped":0,"pct":90.9},"statements":{"total":44,"covered":42,"skipped":0,"pct":95.45},"branches":{"total":30,"covered":26,"skipped":0,"pct":86.66}}
}
12 changes: 6 additions & 6 deletions coverage/lcov-report/Context.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h1><a href="index.html">All files</a> Context.tsx</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">85.71% </span>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/7</span>
<span class='fraction'>7/7</span>
</div>


Expand All @@ -37,9 +37,9 @@ <h1><a href="index.html">All files</a> Context.tsx</h1>


<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
<span class='fraction'>1/1</span>
</div>


Expand Down Expand Up @@ -119,15 +119,15 @@ <h1><a href="index.html">All files</a> Context.tsx</h1>
window?: Window | null;
}
&nbsp;
export const useFrame = <span class="fstat-no" title="function not covered" >()</span> =&gt; <span class="cstat-no" title="statement not covered" >React.useContext&lt;ContextProps&gt;(FrameContext);</span>
export const useFrame = () =&gt; React.useContext&lt;ContextProps&gt;(FrameContext);
&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" rel="noopener noreferrer">istanbul</a>
at 2023-09-05T09:00:22.082Z
at 2023-09-05T09:40:44.343Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
50 changes: 25 additions & 25 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">86.27% </span>
<span class="strong">96.07% </span>
<span class="quiet">Statements</span>
<span class='fraction'>44/51</span>
<span class='fraction'>49/51</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">76.47% </span>
<span class="strong">82.35% </span>
<span class="quiet">Branches</span>
<span class='fraction'>26/34</span>
<span class='fraction'>28/34</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="strong">91.66% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/12</span>
<span class='fraction'>11/12</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">91.3% </span>
<span class="strong">97.82% </span>
<span class="quiet">Lines</span>
<span class='fraction'>42/46</span>
<span class='fraction'>45/46</span>
</div>


Expand Down Expand Up @@ -80,32 +80,32 @@ <h1>All files</h1>
</thead>
<tbody><tr>
<td class="file high" data-value="Context.tsx"><a href="Context.tsx.html">Context.tsx</a></td>
<td data-value="85.71" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="85.71" class="pct high">85.71%</td>
<td data-value="7" class="abs high">6/7</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">7/7</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="4" class="abs medium">2/4</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
</tr>

<tr>
<td class="file high" data-value="index.tsx"><a href="index.tsx.html">index.tsx</a></td>
<td data-value="86.36" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 86%"></div><div class="cover-empty" style="width: 14%"></div></div>
<td data-value="95.45" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="86.36" class="pct high">86.36%</td>
<td data-value="44" class="abs high">38/44</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="30" class="abs high">24/30</td>
<td data-value="81.81" class="pct high">81.81%</td>
<td data-value="11" class="abs high">9/11</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="40" class="abs high">36/40</td>
<td data-value="95.45" class="pct high">95.45%</td>
<td data-value="44" class="abs high">42/44</td>
<td data-value="86.66" class="pct high">86.66%</td>
<td data-value="30" class="abs high">26/30</td>
<td data-value="90.9" class="pct high">90.9%</td>
<td data-value="11" class="abs high">10/11</td>
<td data-value="97.5" class="pct high">97.5%</td>
<td data-value="40" class="abs high">39/40</td>
</tr>

</tbody>
Expand All @@ -116,7 +116,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-09-05T09:00:22.082Z
at 2023-09-05T09:40:44.343Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
96 changes: 48 additions & 48 deletions coverage/lcov-report/index.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1><a href="index.html">All files</a> index.tsx</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">86.36% </span>
<span class="strong">95.45% </span>
<span class="quiet">Statements</span>
<span class='fraction'>38/44</span>
<span class='fraction'>42/44</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">80% </span>
<span class="strong">86.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>24/30</span>
<span class='fraction'>26/30</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">81.81% </span>
<span class="strong">90.9% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/11</span>
<span class='fraction'>10/11</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="strong">97.5% </span>
<span class="quiet">Lines</span>
<span class='fraction'>36/40</span>
<span class='fraction'>39/40</span>
</div>


Expand Down Expand Up @@ -165,68 +165,68 @@ <h1><a href="index.html">All files</a> index.tsx</h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">11x</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">6x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</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">19x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">6x</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">19x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</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">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">19x</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>
Expand Down Expand Up @@ -260,7 +260,7 @@ <h1><a href="index.html">All files</a> index.tsx</h1>
}
};
&nbsp;
useImperativeHandle(ref, <span class="fstat-no" title="function not covered" >()</span> =&gt; <span class="cstat-no" title="statement not covered" >mountNode!,</span> [mountNode]);
useImperativeHandle(ref, () =&gt; mountNode!, [mountNode]);
&nbsp;
const html = initialContent || `&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;`;
const getDoc = () =&gt; (mountNode ? mountNode.contentDocument : <span class="branch-1 cbranch-no" title="branch not covered" >null)</span>;
Expand Down Expand Up @@ -301,15 +301,15 @@ <h1><a href="index.html">All files</a> index.tsx</h1>
const win = doc?.defaultView || <span class="branch-1 cbranch-no" title="branch not covered" >doc?.parentView;</span>
const contents = &lt;FrameContext.Provider value={{ document: doc, window: win }}&gt;{children}&lt;/FrameContext.Provider&gt;;
return [
header &amp;&amp; head &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >createPortal(head, header),</span>
header &amp;&amp; head &amp;&amp; createPortal(head, header),
mountNode &amp;&amp; mountTarget &amp;&amp; createPortal(contents, mountTarget),
];
};
const reProps: IFrameProps = {};
<span class="missing-if-branch" title="if path not taken" >I</span>if (src) {
<span class="cstat-no" title="statement not covered" > delete reProps.srcDoc;</span>
<span class="cstat-no" title="statement not covered" > reProps.src = src;</span>
<span class="cstat-no" title="statement not covered" > reProps.onLoad = other.onLoad;</span>
if (src) {
delete reProps.srcDoc;
reProps.src = src;
reProps.onLoad = other.onLoad;
} else {
reProps.srcDoc = html;
}
Expand All @@ -331,7 +331,7 @@ <h1><a href="index.html">All files</a> index.tsx</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-09-05T09:00:22.082Z
at 2023-09-05T09:40:44.343Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit 4ab9196

Please sign in to comment.