push
github
126 of 136 branches covered (92.65%)
Branch coverage included in aggregate %.
0 of 1 new or added line in 1 file covered. (0.0%)
3 existing lines in 2 files now uncovered.804 of 817 relevant lines covered (98.41%)
13.5 hits per line
1 |
import { Person } from 'gift-exchange'; |
1✔ |
2 |
|
1✔ |
3 |
interface Props { |
1✔ |
4 |
pairs: [Person, Person][];
|
1✔ |
5 |
showGroups: boolean;
|
1✔ |
6 |
} |
1✔ |
7 |
|
1✔ |
8 |
export function Pairs({ pairs, showGroups }: Props) {
|
|
9 |
if (pairs.length < 1) { |
|
10 |
return null;
|
22✔ |
11 |
} |
|
12 |
|
1✔ |
13 |
return (
|
1✔ |
14 |
<table> |
1✔ |
15 |
<caption>Secret Santa Matches</caption> |
1✔ |
16 |
<thead> |
1✔ |
17 |
<tr> |
1✔ |
18 |
<th colSpan={showGroups ? 2 : 1}>Giver</th> |
|
19 |
<th colSpan={showGroups ? 2 : 1}>Receiver</th> |
|
20 |
</tr> |
23✔ |
21 |
{showGroups && ( |
|
UNCOV
22
|
<tr> |
× |
23 |
<th>Name</th> |
× |
24 |
<th>Group</th> |
× |
25 |
<th>Name</th> |
× |
26 |
<th>Group</th> |
× |
27 |
</tr> |
× |
28 |
)} |
23✔ |
29 |
</thead> |
23✔ |
30 |
<tbody> |
23✔ |
31 |
{pairs.map(([a, b]) => ( |
|
32 |
<tr key={a.name}> |
2✔ |
33 |
<td>{a.name}</td> |
2✔ |
34 |
{showGroups && <td>{a.group}</td>} |
|
35 |
<td>{b.name}</td> |
2✔ |
36 |
{showGroups && <td>{b.group}</td>} |
|
37 |
</tr> |
2✔ |
38 |
))} |
23✔ |
39 |
</tbody> |
23✔ |
40 |
</table> |
23✔ |
41 |
); |
23✔ |
42 |
} |
|