Skip to content

Commit

Permalink
changing code cov
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismaelmurekezi committed Jun 26, 2024
1 parent 4f4ffc6 commit 7e8287b
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 36 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
This repository is for multi-vendor E-commerce website

[![codecov](https://codecov.io/gh/atlp-rwanda/e-commerce-crafters-fn/graph/badge.svg?token=ZB2U3Q435X)](https://codecov.io/gh/atlp-rwanda/e-commerce-crafters-fn)

[![codecov](https://codecov.io/gh/atlp-rwanda/e-commerce-crafters-fn/branch/ft-analytics/graph/badge.svg?token=ZB2U3Q435X)](https://codecov.io/gh/atlp-rwanda/e-commerce-crafters-fn)


Expand Down
11 changes: 6 additions & 5 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1719408320848" clover="3.2.0">
<project timestamp="1719408320849" name="All files">
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1" elements="3" coveredelements="3" complexity="0" loc="2" ncloc="2" packages="1" files="1" classes="1"/>
<coverage generated="1719411534857" clover="3.2.0">
<project timestamp="1719411534857" name="All files">
<metrics statements="3" coveredstatements="3" conditionals="2" coveredconditionals="1" methods="1" coveredmethods="1" elements="6" coveredelements="5" complexity="0" loc="3" ncloc="3" packages="1" files="1" classes="1"/>
<file name="Check.tsx" path="/home/ismael/e-commerce-crafters-fn/src/pages/Check.tsx">
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
<metrics statements="3" coveredstatements="3" conditionals="2" coveredconditionals="1" methods="1" coveredmethods="1"/>
<line num="3" count="1" type="stmt"/>
<line num="4" count="1" type="stmt"/>
<line num="4" count="2" type="stmt"/>
<line num="6" count="2" type="stmt"/>
</file>
</project>
</coverage>
2 changes: 1 addition & 1 deletion coverage/coverage-final.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"/home/ismael/e-commerce-crafters-fn/src/pages/Check.tsx": {"path":"/home/ismael/e-commerce-crafters-fn/src/pages/Check.tsx","statementMap":{"0":{"start":{"line":3,"column":14},"end":{"line":15,"column":1}},"1":{"start":{"line":4,"column":2},"end":{"line":14,"column":4}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}},"loc":{"start":{"line":3,"column":20},"end":{"line":15,"column":1}},"line":3}},"branchMap":{},"s":{"0":1,"1":1},"f":{"0":1},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"7b522a5820caa5acd6c653384cd3b765ca0951f9"}
{"/home/ismael/e-commerce-crafters-fn/src/pages/Check.tsx": {"path":"/home/ismael/e-commerce-crafters-fn/src/pages/Check.tsx","statementMap":{"0":{"start":{"line":3,"column":14},"end":{"line":18,"column":1}},"1":{"start":{"line":4,"column":36},"end":{"line":4,"column":51}},"2":{"start":{"line":6,"column":2},"end":{"line":17,"column":4}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}},"loc":{"start":{"line":3,"column":20},"end":{"line":18,"column":1}},"line":3}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":7},"end":{"line":15,"column":44}},"type":"binary-expr","locations":[{"start":{"line":15,"column":7},"end":{"line":15,"column":16}},{"start":{"line":15,"column":20},"end":{"line":15,"column":44}}],"line":15}},"s":{"0":1,"1":2,"2":2},"f":{"0":2},"b":{"0":[2,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"f4fd7aef176069564e1f9661c4424964c5c13b81"}
}
27 changes: 18 additions & 9 deletions coverage/lcov-report/Check.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ <h1><a href="index.html">All files</a> Check.tsx</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>2/2</span>
<span class='fraction'>3/3</span>
</div>


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


Expand All @@ -46,7 +46,7 @@ <h1><a href="index.html">All files</a> Check.tsx</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>2/2</span>
<span class='fraction'>3/3</span>
</div>


Expand Down Expand Up @@ -80,10 +80,15 @@ <h1><a href="index.html">All files</a> Check.tsx</h1>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -97,18 +102,22 @@ <h1><a href="index.html">All files</a> Check.tsx</h1>
<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 React from "react";
<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 React, { useState } from "react";
&nbsp;
const Check = () =&gt; {
const [showExtra, setShowExtra] = useState(false);
&nbsp;
return (
&lt;div className="flex flex-col items-start font-poppins text-sm"&gt;
&lt;h1 className="text-gray-800"&gt;
If you want to part of the program click button below
&lt;/h1&gt;
&lt;button className=" py-2 px-7 ml-10 mt-5 bg-purple-700 text-white rounded-md hover:bg-purple-500"&gt;
&lt;button className="py-2 px-7 ml-10 mt-5 bg-purple-700 text-white rounded-md hover:bg-purple-500"&gt;
Confirm
&lt;/button&gt;
&lt;h1&gt;hello there&lt;/h1&gt;
{showExtra &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >&lt;h2&gt;You are welcome&lt;/h2&gt;}</span>
&lt;/div&gt;
);
};
Expand All @@ -121,7 +130,7 @@ <h1><a href="index.html">All files</a> Check.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 2024-06-26T13:25:20.845Z
at 2024-06-26T14:18:54.854Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
18 changes: 9 additions & 9 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ <h1>All files</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>2/2</span>
<span class='fraction'>3/3</span>
</div>


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


Expand All @@ -46,7 +46,7 @@ <h1>All files</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>2/2</span>
<span class='fraction'>3/3</span>
</div>


Expand Down Expand Up @@ -84,13 +84,13 @@ <h1>All files</h1>
<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="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="2" class="abs medium">1/2</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="2" class="abs high">2/2</td>
<td data-value="3" class="abs high">3/3</td>
</tr>

</tbody>
Expand All @@ -101,7 +101,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 2024-06-26T13:25:20.845Z
at 2024-06-26T14:18:54.854Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
15 changes: 9 additions & 6 deletions coverage/lcov.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ SF:src/pages/Check.tsx
FN:3,(anonymous_0)
FNF:1
FNH:1
FNDA:1,(anonymous_0)
FNDA:2,(anonymous_0)
DA:3,1
DA:4,1
LF:2
LH:2
BRF:0
BRH:0
DA:4,2
DA:6,2
LF:3
LH:3
BRDA:15,0,0,2
BRDA:15,0,1,0
BRF:2
BRH:1
end_of_record
7 changes: 5 additions & 2 deletions src/--test--/Check.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ describe("Test component", () => {

const button = screen.getByRole("button", { name: /confirm/i });
expect(button).toBeTruthy();
});

test("Greetings", () => {
render(<Check />);
const secondHeading = screen.getByText(/hello there/i);
expect(secondHeading).toBeTruthy();
});
});


7 changes: 5 additions & 2 deletions src/pages/Check.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from "react";
import React, { useState } from "react";

const Check = () => {
const [showExtra, setShowExtra] = useState(false);

return (
<div className="flex flex-col items-start font-poppins text-sm">
<h1 className="text-gray-800">
If you want to part of the program click button below
</h1>
<button className=" py-2 px-7 ml-10 mt-5 bg-purple-700 text-white rounded-md hover:bg-purple-500">
<button className="py-2 px-7 ml-10 mt-5 bg-purple-700 text-white rounded-md hover:bg-purple-500">
Confirm
</button>
<h1>hello there</h1>
{showExtra && <h2>You are welcome</h2>}
</div>
);
};
Expand Down

0 comments on commit 7e8287b

Please sign in to comment.