modified: .gitignore

This commit is contained in:
2025-11-24 20:31:43 +10:00
parent e1a90ff5d4
commit fc01c3deff
24 changed files with 5977 additions and 0 deletions
+1
View File
@@ -5,3 +5,4 @@ app/build/
.gradle .gradle
test-results/ test-results/
playwright-report/ playwright-report/
.tmp/
+224
View File
@@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}
+87
View File
@@ -0,0 +1,87 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selector that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);
+413
View File
@@ -0,0 +1,413 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1763980134399" clover="3.2.0">
<project timestamp="1763980134402" name="All files">
<metrics statements="368" coveredstatements="279" conditionals="228" coveredconditionals="152" methods="111" coveredmethods="85" elements="707" coveredelements="516" complexity="0" loc="368" ncloc="368" packages="5" files="8" classes="8"/>
<package name="components">
<metrics statements="46" coveredstatements="32" conditionals="32" coveredconditionals="21" methods="23" coveredmethods="15"/>
<file name="BarcodeScannerView.tsx" path="/mnt/server/github-repos/stockfill/src/components/BarcodeScannerView.tsx">
<metrics statements="6" coveredstatements="1" conditionals="8" coveredconditionals="0" methods="2" coveredmethods="0"/>
<line num="9" count="1" type="stmt"/>
<line num="10" count="0" type="stmt"/>
<line num="12" count="0" type="stmt"/>
<line num="13" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="14" count="0" type="stmt"/>
<line num="18" count="0" type="stmt"/>
</file>
<file name="ProductRow.tsx" path="/mnt/server/github-repos/stockfill/src/components/ProductRow.tsx">
<metrics statements="40" coveredstatements="31" conditionals="24" coveredconditionals="21" methods="21" coveredmethods="15"/>
<line num="42" count="24" type="stmt"/>
<line num="48" count="2" type="stmt"/>
<line num="49" count="102" type="stmt"/>
<line num="50" count="102" type="stmt"/>
<line num="51" count="102" type="stmt"/>
<line num="52" count="102" type="stmt"/>
<line num="54" count="102" type="stmt"/>
<line num="55" count="12" type="stmt"/>
<line num="56" count="12" type="stmt"/>
<line num="59" count="131" type="stmt"/>
<line num="60" count="34" type="stmt"/>
<line num="61" count="34" type="stmt"/>
<line num="64" count="102" type="stmt"/>
<line num="65" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="66" count="5" type="stmt"/>
<line num="67" count="5" type="stmt"/>
<line num="72" count="1" type="stmt"/>
<line num="73" count="1" type="stmt"/>
<line num="75" count="4" type="cond" truecount="4" falsecount="0"/>
<line num="76" count="2" type="stmt"/>
<line num="77" count="2" type="stmt"/>
<line num="79" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="80" count="2" type="stmt"/>
<line num="81" count="2" type="stmt"/>
<line num="83" count="0" type="stmt"/>
<line num="87" count="102" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="89" count="0" type="stmt"/>
<line num="90" count="0" type="stmt"/>
<line num="93" count="102" type="stmt"/>
<line num="115" count="82" type="stmt"/>
<line num="133" count="1" type="stmt"/>
<line num="134" count="1" type="stmt"/>
<line num="143" count="0" type="stmt"/>
<line num="150" count="0" type="stmt"/>
<line num="182" count="5" type="stmt"/>
<line num="185" count="1" type="stmt"/>
<line num="192" count="0" type="stmt"/>
<line num="197" count="0" type="stmt"/>
<line num="198" count="0" type="stmt"/>
</file>
</package>
<package name="hooks">
<metrics statements="40" coveredstatements="1" conditionals="20" coveredconditionals="0" methods="8" coveredmethods="0"/>
<file name="useBarcodeScanner.ts" path="/mnt/server/github-repos/stockfill/src/hooks/useBarcodeScanner.ts">
<metrics statements="40" coveredstatements="1" conditionals="20" coveredconditionals="0" methods="8" coveredmethods="0"/>
<line num="12" count="1" type="stmt"/>
<line num="13" count="0" type="stmt"/>
<line num="14" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="17" count="0" type="stmt"/>
<line num="18" count="0" type="stmt"/>
<line num="20" count="0" type="stmt"/>
<line num="22" count="0" type="stmt"/>
<line num="23" count="0" type="stmt"/>
<line num="25" count="0" type="stmt"/>
<line num="27" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="28" count="0" type="stmt"/>
<line num="29" count="0" type="stmt"/>
<line num="30" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="31" count="0" type="stmt"/>
<line num="32" count="0" type="stmt"/>
<line num="33" count="0" type="stmt"/>
<line num="35" count="0" type="stmt"/>
<line num="36" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="37" count="0" type="stmt"/>
<line num="38" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="39" count="0" type="stmt"/>
<line num="40" count="0" type="stmt"/>
<line num="41" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="42" count="0" type="stmt"/>
<line num="44" count="0" type="stmt"/>
<line num="47" count="0" type="stmt"/>
<line num="49" count="0" type="stmt"/>
<line num="53" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="54" count="0" type="stmt"/>
<line num="58" count="0" type="stmt"/>
<line num="61" count="0" type="stmt"/>
<line num="65" count="0" type="stmt"/>
<line num="66" count="0" type="stmt"/>
<line num="67" count="0" type="stmt"/>
<line num="68" count="0" type="stmt"/>
<line num="69" count="0" type="stmt"/>
<line num="70" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="71" count="0" type="stmt"/>
<line num="76" count="0" type="stmt"/>
</file>
</package>
<package name="models">
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<file name="Product.ts" path="/mnt/server/github-repos/stockfill/src/models/Product.ts">
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<line num="13" count="1" type="stmt"/>
<line num="14" count="1" type="stmt"/>
</file>
</package>
<package name="modules">
<metrics statements="17" coveredstatements="15" conditionals="22" coveredconditionals="19" methods="3" coveredmethods="2"/>
<file name="openFoodFacts.ts" path="/mnt/server/github-repos/stockfill/src/modules/openFoodFacts.ts">
<metrics statements="17" coveredstatements="15" conditionals="22" coveredconditionals="19" methods="3" coveredmethods="2"/>
<line num="9" count="1" type="stmt"/>
<line num="10" count="1" type="stmt"/>
<line num="12" count="2" type="cond" truecount="3" falsecount="0"/>
<line num="14" count="1" type="stmt"/>
<line num="15" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="16" count="0" type="stmt"/>
<line num="19" count="2" type="stmt"/>
<line num="20" count="2" type="stmt"/>
<line num="22" count="2" type="stmt"/>
<line num="23" count="2" type="stmt"/>
<line num="24" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="26" count="2" type="stmt"/>
<line num="36" count="2" type="cond" truecount="5" falsecount="0"/>
<line num="37" count="1" type="stmt"/>
<line num="40" count="1" type="stmt"/>
<line num="48" count="0" type="stmt"/>
<line num="50" count="2" type="stmt"/>
</file>
</package>
<package name="screens">
<metrics statements="263" coveredstatements="229" conditionals="154" coveredconditionals="112" methods="77" coveredmethods="68"/>
<file name="ManageCategoriesScreen.tsx" path="/mnt/server/github-repos/stockfill/src/screens/ManageCategoriesScreen.tsx">
<metrics statements="62" coveredstatements="53" conditionals="28" coveredconditionals="17" methods="17" coveredmethods="16"/>
<line num="23" count="1" type="stmt"/>
<line num="24" count="28" type="stmt"/>
<line num="25" count="28" type="stmt"/>
<line num="26" count="28" type="stmt"/>
<line num="27" count="28" type="stmt"/>
<line num="28" count="28" type="stmt"/>
<line num="29" count="28" type="stmt"/>
<line num="30" count="28" type="stmt"/>
<line num="32" count="28" type="stmt"/>
<line num="33" count="4" type="stmt"/>
<line num="34" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="35" count="4" type="stmt"/>
<line num="39" count="28" type="stmt"/>
<line num="40" count="2" type="stmt"/>
<line num="41" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="42" count="2" type="stmt"/>
<line num="43" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="44" count="1" type="stmt"/>
<line num="45" count="1" type="stmt"/>
<line num="47" count="1" type="stmt"/>
<line num="48" count="1" type="stmt"/>
<line num="49" count="1" type="stmt"/>
<line num="52" count="28" type="stmt"/>
<line num="53" count="1" type="stmt"/>
<line num="54" count="1" type="stmt"/>
<line num="55" count="1" type="stmt"/>
<line num="58" count="28" type="stmt"/>
<line num="59" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="60" count="1" type="stmt"/>
<line num="61" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="63" count="1" type="stmt"/>
<line num="64" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="66" count="1" type="stmt"/>
<line num="67" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="69" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="70" count="0" type="stmt"/>
<line num="71" count="0" type="stmt"/>
<line num="74" count="1" type="stmt"/>
<line num="75" count="1" type="stmt"/>
<line num="76" count="1" type="stmt"/>
<line num="82" count="1" type="stmt"/>
<line num="83" count="1" type="stmt"/>
<line num="84" count="1" type="stmt"/>
<line num="87" count="28" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="89" count="0" type="stmt"/>
<line num="90" count="0" type="stmt"/>
<line num="93" count="28" type="stmt"/>
<line num="94" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="95" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="96" count="1" type="stmt"/>
<line num="100" count="1" type="stmt"/>
<line num="102" count="0" type="stmt"/>
<line num="103" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="104" count="0" type="stmt"/>
<line num="106" count="0" type="stmt"/>
<line num="109" count="28" type="stmt"/>
<line num="121" count="12" type="stmt"/>
<line num="129" count="28" type="stmt"/>
<line num="136" count="7" type="stmt"/>
<line num="150" count="1" type="stmt"/>
<line num="157" count="1" type="stmt"/>
</file>
<file name="ManageProductsScreen.tsx" path="/mnt/server/github-repos/stockfill/src/screens/ManageProductsScreen.tsx">
<metrics statements="152" coveredstatements="128" conditionals="106" coveredconditionals="82" methods="43" coveredmethods="35"/>
<line num="27" count="1" type="stmt"/>
<line num="28" count="75" type="stmt"/>
<line num="29" count="75" type="stmt"/>
<line num="30" count="75" type="stmt"/>
<line num="31" count="75" type="stmt"/>
<line num="32" count="75" type="stmt"/>
<line num="33" count="75" type="stmt"/>
<line num="34" count="75" type="stmt"/>
<line num="35" count="75" type="stmt"/>
<line num="36" count="75" type="stmt"/>
<line num="37" count="75" type="stmt"/>
<line num="38" count="75" type="stmt"/>
<line num="39" count="75" type="stmt"/>
<line num="40" count="75" type="stmt"/>
<line num="43" count="75" type="stmt"/>
<line num="44" count="75" type="stmt"/>
<line num="46" count="75" type="stmt"/>
<line num="47" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="49" count="3" type="cond" truecount="5" falsecount="0"/>
<line num="50" count="1" type="stmt"/>
<line num="51" count="1" type="stmt"/>
<line num="52" count="1" type="stmt"/>
<line num="55" count="2" type="stmt"/>
<line num="56" count="2" type="stmt"/>
<line num="58" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="59" count="1" type="stmt"/>
<line num="60" count="1" type="stmt"/>
<line num="61" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="62" count="1" type="cond" truecount="2" falsecount="1"/>
<line num="65" count="1" type="stmt"/>
<line num="66" count="1" type="stmt"/>
<line num="70" count="75" type="stmt"/>
<line num="71" count="10" type="stmt"/>
<line num="72" count="9" type="stmt"/>
<line num="73" count="9" type="stmt"/>
<line num="76" count="75" type="stmt"/>
<line num="78" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="79" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="84" count="75" type="stmt"/>
<line num="86" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="88" count="5" type="stmt"/>
<line num="90" count="5" type="stmt"/>
<line num="91" count="5" type="cond" truecount="2" falsecount="0"/>
<line num="97" count="75" type="stmt"/>
<line num="99" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="102" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="104" count="0" type="cond" truecount="2" falsecount="2"/>
<line num="105" count="2" type="stmt"/>
<line num="106" count="2" type="stmt"/>
<line num="107" count="2" type="stmt"/>
<line num="113" count="75" type="stmt"/>
<line num="115" count="5" type="stmt"/>
<line num="116" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="118" count="5" type="stmt"/>
<line num="120" count="5" type="cond" truecount="2" falsecount="0"/>
<line num="121" count="2" type="stmt"/>
<line num="122" count="2" type="stmt"/>
<line num="123" count="2" type="stmt"/>
<line num="129" count="75" type="stmt"/>
<line num="131" count="1" type="stmt"/>
<line num="132" count="1" type="stmt"/>
<line num="134" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="139" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="141" count="1" type="stmt"/>
<line num="143" count="1" type="stmt"/>
<line num="146" count="0" type="stmt"/>
<line num="149" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="151" count="1" type="stmt"/>
<line num="167" count="75" type="stmt"/>
<line num="168" count="18" type="cond" truecount="1" falsecount="1"/>
<line num="169" count="18" type="cond" truecount="2" falsecount="0"/>
<line num="170" count="9" type="stmt"/>
<line num="174" count="75" type="stmt"/>
<line num="175" count="10" type="cond" truecount="3" falsecount="1"/>
<line num="176" count="0" type="stmt"/>
<line num="180" count="75" type="stmt"/>
<line num="182" count="14" type="stmt"/>
<line num="183" count="13" type="stmt"/>
<line num="186" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="187" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="192" count="75" type="stmt"/>
<line num="193" count="14" type="stmt"/>
<line num="197" count="75" type="stmt"/>
<line num="198" count="9" type="stmt"/>
<line num="199" count="9" type="cond" truecount="1" falsecount="1"/>
<line num="200" count="0" type="stmt"/>
<line num="201" count="0" type="stmt"/>
<line num="205" count="75" type="stmt"/>
<line num="206" count="12" type="cond" truecount="2" falsecount="0"/>
<line num="207" count="9" type="stmt"/>
<line num="208" count="9" type="stmt"/>
<line num="210" count="12" type="stmt"/>
<line num="213" count="75" type="stmt"/>
<line num="214" count="3" type="cond" truecount="3" falsecount="1"/>
<line num="216" count="3" type="stmt"/>
<line num="217" count="3" type="stmt"/>
<line num="218" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="220" count="2" type="cond" truecount="4" falsecount="0"/>
<line num="221" count="1" type="stmt"/>
<line num="222" count="1" type="stmt"/>
<line num="224" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="225" count="1" type="stmt"/>
<line num="226" count="1" type="stmt"/>
<line num="228" count="0" type="stmt"/>
<line num="230" count="1" type="stmt"/>
<line num="231" count="1" type="stmt"/>
<line num="232" count="1" type="stmt"/>
<line num="244" count="3" type="stmt"/>
<line num="245" count="1" type="stmt"/>
<line num="246" count="1" type="stmt"/>
<line num="248" count="1" type="stmt"/>
<line num="249" count="1" type="stmt"/>
<line num="250" count="1" type="stmt"/>
<line num="251" count="1" type="stmt"/>
<line num="254" count="75" type="stmt"/>
<line num="262" count="2" type="stmt"/>
<line num="263" count="1" type="stmt"/>
<line num="265" count="0" type="stmt"/>
<line num="266" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="268" count="0" type="stmt"/>
<line num="269" count="0" type="stmt"/>
<line num="270" count="0" type="stmt"/>
<line num="279" count="0" type="stmt"/>
<line num="280" count="0" type="stmt"/>
<line num="281" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="283" count="0" type="stmt"/>
<line num="286" count="75" type="stmt"/>
<line num="287" count="1" type="stmt"/>
<line num="288" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="289" count="1" type="stmt"/>
<line num="293" count="1" type="stmt"/>
<line num="295" count="0" type="stmt"/>
<line num="296" count="0" type="stmt"/>
<line num="299" count="75" type="stmt"/>
<line num="308" count="0" type="stmt"/>
<line num="320" count="4" type="stmt"/>
<line num="328" count="1" type="stmt"/>
<line num="334" count="82" type="stmt"/>
<line num="346" count="38" type="stmt"/>
<line num="347" count="38" type="stmt"/>
<line num="357" count="0" type="stmt"/>
<line num="358" count="0" type="stmt"/>
<line num="373" count="0" type="stmt"/>
<line num="377" count="82" type="stmt"/>
<line num="387" count="0" type="stmt"/>
<line num="392" count="0" type="stmt"/>
<line num="416" count="3" type="stmt"/>
<line num="430" count="50" type="stmt"/>
<line num="440" count="0" type="stmt"/>
<line num="445" count="3" type="stmt"/>
<line num="446" count="3" type="stmt"/>
<line num="447" count="3" type="stmt"/>
</file>
<file name="PickListsScreen.tsx" path="/mnt/server/github-repos/stockfill/src/screens/PickListsScreen.tsx">
<metrics statements="49" coveredstatements="48" conditionals="20" coveredconditionals="13" methods="17" coveredmethods="17"/>
<line num="25" count="1" type="stmt"/>
<line num="26" count="22" type="stmt"/>
<line num="27" count="22" type="stmt"/>
<line num="28" count="22" type="stmt"/>
<line num="29" count="22" type="stmt"/>
<line num="30" count="22" type="stmt"/>
<line num="31" count="22" type="stmt"/>
<line num="33" count="22" type="stmt"/>
<line num="34" count="4" type="stmt"/>
<line num="35" count="12" type="stmt"/>
<line num="36" count="4" type="stmt"/>
<line num="39" count="22" type="stmt"/>
<line num="40" count="4" type="stmt"/>
<line num="41" count="16" type="stmt"/>
<line num="44" count="4" type="stmt"/>
<line num="45" count="8" type="stmt"/>
<line num="49" count="8" type="cond" truecount="1" falsecount="1"/>
<line num="50" count="0" type="stmt"/>
<line num="54" count="66" type="cond" truecount="1" falsecount="1"/>
<line num="56" count="22" type="stmt"/>
<line num="57" count="1" type="stmt"/>
<line num="58" count="1" type="stmt"/>
<line num="59" count="1" type="cond" truecount="2" falsecount="0"/>
<line num="62" count="22" type="stmt"/>
<line num="63" count="1" type="stmt"/>
<line num="64" count="1" type="stmt"/>
<line num="65" count="1" type="stmt"/>
<line num="68" count="22" type="stmt"/>
<line num="69" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="70" count="1" type="stmt"/>
<line num="71" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="72" count="1" type="stmt"/>
<line num="73" count="1" type="stmt"/>
<line num="79" count="22" type="stmt"/>
<line num="80" count="1" type="stmt"/>
<line num="81" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="82" count="1" type="stmt"/>
<line num="83" count="1" type="stmt"/>
<line num="86" count="22" type="stmt"/>
<line num="96" count="66" type="stmt"/>
<line num="102" count="1" type="stmt"/>
<line num="103" count="1" type="stmt"/>
<line num="104" count="1" type="stmt"/>
<line num="113" count="1" type="stmt"/>
<line num="114" count="1" type="stmt"/>
<line num="115" count="1" type="stmt"/>
<line num="151" count="1" type="stmt"/>
<line num="154" count="51" type="stmt"/>
<line num="162" count="15" type="stmt"/>
</file>
</package>
</project>
</coverage>
@@ -0,0 +1,175 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/BarcodeScannerView.tsx</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">components</a> BarcodeScannerView.tsx</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">16.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">16.66% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/6</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</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-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-yes">1x</span>
<span class="cline-any cline-no">&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-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-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></td><td class="text"><pre class="prettyprint lang-js">import { useEffect } from 'react';
import { Alert, Card, CardContent, Typography } from '@mui/material';
import { useBarcodeScanner } from '../hooks/useBarcodeScanner';
&nbsp;
interface BarcodeScannerViewProps {
onDetected?: (code: string) =&gt; void;
}
&nbsp;
export const BarcodeScannerView = <span class="fstat-no" title="function not covered" >({</span> onDetected }: BarcodeScannerViewProps) =&gt; {
const { videoRef, result <span class="cstat-no" title="statement not covered" >} = useBarcodeScanner();</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > if (result.code &amp;&amp; onDetected) {</span>
<span class="cstat-no" title="statement not covered" > onDetected(result.code);</span>
}
}, [onDetected, result.code]);
&nbsp;
<span class="cstat-no" title="statement not covered" > return (</span>
&lt;Card variant="outlined"&gt;
&lt;CardContent&gt;
&lt;Typography variant="subtitle1" gutterBottom&gt;
Scan Barcode
&lt;/Typography&gt;
&lt;video ref={videoRef} style={{ width: '100%', borderRadius: 8 }} /&gt;
{result.code ? &lt;Alert severity="success"&gt;Detected {result.code}&lt;/Alert&gt; : null}
{result.error ? &lt;Alert severity="error"&gt;{result.error}&lt;/Alert&gt; : null}
&lt;/CardContent&gt;
&lt;/Card&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" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+700
View File
@@ -0,0 +1,700 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/ProductRow.tsx</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">components</a> ProductRow.tsx</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">77.55% </span>
<span class="quiet">Statements</span>
<span class='fraction'>38/49</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.5% </span>
<span class="quiet">Branches</span>
<span class='fraction'>21/24</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">71.42% </span>
<span class="quiet">Functions</span>
<span class='fraction'>15/21</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">77.5% </span>
<span class="quiet">Lines</span>
<span class='fraction'>31/40</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</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-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>
<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>
<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-yes">24x</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-yes">2x</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">131x</span>
<span class="cline-any cline-yes">34x</span>
<span class="cline-any cline-yes">34x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</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">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</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-neutral">&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-yes">102x</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">102x</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>
<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-yes">82x</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>
<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-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-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-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>
<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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<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-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-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-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></td><td class="text"><pre class="prettyprint lang-js">import {
Box,
Button,
Card,
CardContent,
Dialog,
DialogContent,
DialogTitle,
IconButton,
Stack,
TextField,
Typography,
} from '@mui/material';
import DeleteIcon from '@mui/icons-material/Delete';
import EditIcon from '@mui/icons-material/Edit';
import CheckIcon from '@mui/icons-material/Check';
import CloseIcon from '@mui/icons-material/Close';
import { ChangeEvent, useEffect, useState } from 'react';
import { Product } from '../models/Product';
import { BarcodeScannerView } from './BarcodeScannerView';
&nbsp;
interface ProductRowProps {
product: Product;
categories: string[];
onSave: (
productId: string,
updates: {
name: string;
category: string;
barcode?: string;
},
) =&gt; Promise&lt;void&gt; | void;
onDelete: (productId: string) =&gt; Promise&lt;void&gt; | void;
}
&nbsp;
interface ProductFormState {
name: string;
category: string;
barcode: string;
}
&nbsp;
const getInitialFormState = (product: Product): ProductFormState =&gt; ({
name: product.name,
category: product.category,
barcode: product.barcode ?? '',
});
&nbsp;
export const ProductRow = ({ product, categories, onSave, onDelete }: ProductRowProps) =&gt; {
const [isEditing, setIsEditing] = useState(false);
const [formState, setFormState] = useState&lt;ProductFormState&gt;(() =&gt; getInitialFormState(product));
const [isScannerOpen, setIsScannerOpen] = useState(false);
const [fieldErrors, setFieldErrors] = useState&lt;{ name?: string; barcode?: string }&gt;({});
&nbsp;
useEffect(() =&gt; {
setFormState(getInitialFormState(product));
setFieldErrors({});
}, [product]);
&nbsp;
const handleChange = (field: keyof ProductFormState) =&gt; (event: ChangeEvent&lt;HTMLInputElement&gt;) =&gt; {
setFormState((prev) =&gt; ({ ...prev, [field]: event.target.value }));
setFieldErrors((prev) =&gt; ({ ...prev, [field]: undefined }));
};
&nbsp;
const handleSave = async () =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!formState.name) <span class="cstat-no" title="statement not covered" >return;</span>
try {
await onSave(product.id, {
name: formState.name,
category: formState.category,
barcode: formState.barcode || <span class="branch-1 cbranch-no" title="branch not covered" >undefined,</span>
});
setIsEditing(false);
setFieldErrors({});
} catch (error) {
if (error instanceof Error &amp;&amp; error.name === 'DuplicateNameError') {
setFieldErrors({ name: 'A product with this name already exists.' });
return;
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (error instanceof Error &amp;&amp; error.name === 'DuplicateBarcodeError') {
setFieldErrors({ barcode: 'This barcode is already assigned to another product.' });
return;
}
<span class="cstat-no" title="statement not covered" > throw error;</span>
}
};
&nbsp;
const handleCancel = <span class="fstat-no" title="function not covered" >() =&gt; {</span>
<span class="cstat-no" title="statement not covered" > setIsEditing(false);</span>
<span class="cstat-no" title="statement not covered" > setFormState(getInitialFormState(product));</span>
<span class="cstat-no" title="statement not covered" > setFieldErrors({});</span>
};
&nbsp;
return (
&lt;Card variant="outlined" sx={{ mb: 1 }}&gt;
&lt;CardContent sx={{ p: 1.25, '&amp;:last-child': { pb: 1.25 } }}&gt;
{isEditing ? (
&lt;Stack spacing={1}&gt;
&lt;TextField
label="Name"
value={formState.name}
onChange={handleChange('name')}
size="small"
error={Boolean(fieldErrors.name)}
helperText={fieldErrors.name || undefined}
/&gt;
&lt;TextField
select
SelectProps={{ native: true }}
label="Category"
value={formState.category}
onChange={handleChange('category')}
size="small"
&gt;
{categories.map((cat) =&gt; (
&lt;option key={cat} value={cat}&gt;
{cat}
&lt;/option&gt;
))}
&lt;/TextField&gt;
{formState.barcode ? (
&lt;TextField
label="Barcode"
value={formState.barcode}
onChange={handleChange('barcode')}
size="small"
error={Boolean(fieldErrors.barcode)}
helperText={fieldErrors.barcode || undefined}
InputProps={{
endAdornment: (
&lt;Button
size="small"
onClick={() =&gt; {
setFormState((prev) =&gt; ({ ...prev, barcode: '' }));
setFieldErrors((prev) =&gt; ({ ...prev, barcode: undefined }));
}}
&gt;
Clear
&lt;/Button&gt;
),
}}
/&gt;
) : (
&lt;Button variant="outlined" onClick={<span class="fstat-no" title="function not covered" >() =&gt; <span class="cstat-no" title="statement not covered" >s</span>etIsScannerOpen(true)}&gt;</span>
Scan Barcode
&lt;/Button&gt;
)}
&lt;Stack direction="row" spacing={0.5} justifyContent="flex-end" alignItems="center"&gt;
&lt;IconButton
aria-label={`Delete ${product.name}`}
onClick={<span class="fstat-no" title="function not covered" >() =&gt; <span class="cstat-no" title="statement not covered" >o</span>nDelete(product.id)}</span>
size="small"
color="error"
&gt;
&lt;DeleteIcon fontSize="small" /&gt;
&lt;/IconButton&gt;
&lt;IconButton aria-label="Save product" onClick={handleSave} disabled={!formState.name} color="primary"&gt;
&lt;CheckIcon /&gt;
&lt;/IconButton&gt;
&lt;IconButton aria-label="Cancel edit" onClick={handleCancel}&gt;
&lt;CloseIcon /&gt;
&lt;/IconButton&gt;
&lt;/Stack&gt;
&lt;/Stack&gt;
) : (
&lt;Stack direction="row" alignItems="center" spacing={1} justifyContent="space-between"&gt;
&lt;Stack direction="row" spacing={1.5} alignItems="center" sx={{ flex: 1, minWidth: 0 }}&gt;
&lt;Stack spacing={0.25} sx={{ minWidth: 0 }}&gt;
&lt;Typography variant="subtitle1" noWrap&gt;
{product.name}
&lt;/Typography&gt;
&lt;Typography variant="caption" color="text.secondary" noWrap&gt;
{product.category}
&lt;/Typography&gt;
&lt;/Stack&gt;
{product.barcode ? (
&lt;Typography variant="caption" color="text.secondary" noWrap&gt;
Barcode: {product.barcode}
&lt;/Typography&gt;
) : null}
&lt;/Stack&gt;
&lt;Box display="flex" alignItems="center" gap={0.5} sx={{ ml: 1 }}&gt;
&lt;IconButton aria-label={`Edit ${product.name}`} onClick={() =&gt; setIsEditing(true)} size="small"&gt;
&lt;EditIcon fontSize="small" /&gt;
&lt;/IconButton&gt;
&lt;IconButton aria-label={`Delete ${product.name}`} onClick={() =&gt; onDelete(product.id)} size="small"&gt;
&lt;DeleteIcon fontSize="small" /&gt;
&lt;/IconButton&gt;
&lt;/Box&gt;
&lt;/Stack&gt;
)}
&lt;/CardContent&gt;
&lt;Dialog open={isScannerOpen} onClose={<span class="fstat-no" title="function not covered" >() =&gt; <span class="cstat-no" title="statement not covered" >s</span>etIsScannerOpen(false)} f</span>ullWidth&gt;
&lt;DialogTitle&gt;Scan Barcode&lt;/DialogTitle&gt;
&lt;DialogContent&gt;
&lt;BarcodeScannerView
onDetected={<span class="fstat-no" title="function not covered" >(c</span>ode) =&gt; {
<span class="cstat-no" title="statement not covered" > setFormState(<span class="fstat-no" title="function not covered" >(p</span>rev) =&gt; (<span class="cstat-no" title="statement not covered" >{ ...prev, barcode: code }))</span>;</span>
<span class="cstat-no" title="statement not covered" > setIsScannerOpen(false);</span>
}}
/&gt;
&lt;/DialogContent&gt;
&lt;/Dialog&gt;
&lt;/Card&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" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+131
View File
@@ -0,0 +1,131 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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> components</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">70.9% </span>
<span class="quiet">Statements</span>
<span class='fraction'>39/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">65.62% </span>
<span class="quiet">Branches</span>
<span class='fraction'>21/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">65.21% </span>
<span class="quiet">Functions</span>
<span class='fraction'>15/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.56% </span>
<span class="quiet">Lines</span>
<span class='fraction'>32/46</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="BarcodeScannerView.tsx"><a href="BarcodeScannerView.tsx.html">BarcodeScannerView.tsx</a></td>
<td data-value="16.66" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 16%"></div><div class="cover-empty" style="width: 84%"></div></div>
</td>
<td data-value="16.66" class="pct low">16.66%</td>
<td data-value="6" class="abs low">1/6</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">0/8</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">0/2</td>
<td data-value="16.66" class="pct low">16.66%</td>
<td data-value="6" class="abs low">1/6</td>
</tr>
<tr>
<td class="file medium" data-value="ProductRow.tsx"><a href="ProductRow.tsx.html">ProductRow.tsx</a></td>
<td data-value="77.55" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 77%"></div><div class="cover-empty" style="width: 23%"></div></div>
</td>
<td data-value="77.55" class="pct medium">77.55%</td>
<td data-value="49" class="abs medium">38/49</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="24" class="abs high">21/24</td>
<td data-value="71.42" class="pct medium">71.42%</td>
<td data-value="21" class="abs medium">15/21</td>
<td data-value="77.5" class="pct medium">77.5%</td>
<td data-value="40" class="abs medium">31/40</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

+116
View File
@@ -0,0 +1,116 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for hooks</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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> hooks</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">2.27% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">2.5% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/40</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="useBarcodeScanner.ts"><a href="useBarcodeScanner.ts.html">useBarcodeScanner.ts</a></td>
<td data-value="2.27" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 2%"></div><div class="cover-empty" style="width: 98%"></div></div>
</td>
<td data-value="2.27" class="pct low">2.27%</td>
<td data-value="44" class="abs low">1/44</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="20" class="abs low">0/20</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">0/8</td>
<td data-value="2.5" class="pct low">2.5%</td>
<td data-value="40" class="abs low">1/40</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+316
View File
@@ -0,0 +1,316 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for hooks/useBarcodeScanner.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">hooks</a> useBarcodeScanner.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">2.27% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">2.5% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/40</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</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-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-yes">1x</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-no">&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-no">&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-no">&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-no">&nbsp;</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-no">&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-no">&nbsp;</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-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&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-no">&nbsp;</span>
<span class="cline-any cline-neutral">&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-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-no">&nbsp;</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-neutral">&nbsp;</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-no">&nbsp;</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-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-no">&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 { useEffect, useRef, useState } from 'react';
import { BrowserMultiFormatReader } from '@zxing/browser';
&nbsp;
type BarcodeDetection = { rawValue: string };
type BarcodeDetectorClass = new () =&gt; { detect: (source: ImageBitmapSource) =&gt; Promise&lt;BarcodeDetection[]&gt; };
&nbsp;
export interface BarcodeResult {
code?: string;
error?: string;
}
&nbsp;
export const useBarcodeScanner = <span class="fstat-no" title="function not covered" >() =&gt; {</span>
const <span class="cstat-no" title="statement not covered" >videoRef = useRef&lt;HTMLVideoElement | null&gt;(null);</span>
const [result, setResult<span class="cstat-no" title="statement not covered" >] = useState&lt;BarcodeResult&gt;({});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
const reader = <span class="cstat-no" title="statement not covered" >new BrowserMultiFormatReader();</span>
let active = <span class="cstat-no" title="statement not covered" >true;</span>
let stop: (() =&gt; void) | undefined;
let currentVideoElement: HTMLVideoElement | null = <span class="cstat-no" title="statement not covered" >null;</span>
&nbsp;
const start = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >async () =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > try {</span>
const detectorClass = (
<span class="cstat-no" title="statement not covered" > window as typeof window &amp; { BarcodeDetector?: BarcodeDetectorClass }</span>
).BarcodeDetector;
<span class="cstat-no" title="statement not covered" > if (detectorClass) {</span>
const detector = <span class="cstat-no" title="statement not covered" >new detectorClass();</span>
const stream = <span class="cstat-no" title="statement not covered" >await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' } });</span>
<span class="cstat-no" title="statement not covered" > if (videoRef.current) {</span>
<span class="cstat-no" title="statement not covered" > videoRef.current.srcObject = stream;</span>
<span class="cstat-no" title="statement not covered" > await videoRef.current.play();</span>
<span class="cstat-no" title="statement not covered" > currentVideoElement = videoRef.current;</span>
}
const scan = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >async () =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > if (!active || !videoRef.current) <span class="cstat-no" title="statement not covered" >return;</span></span>
const tracks = (<span class="cstat-no" title="statement not covered" >videoRef.current.srcObject as MediaStream | null)?.getVideoTracks();</span>
<span class="cstat-no" title="statement not covered" > if (!tracks || tracks.length === 0) <span class="cstat-no" title="statement not covered" >return;</span></span>
const frame = <span class="cstat-no" title="statement not covered" >await createImageBitmap(videoRef.current);</span>
const codes = <span class="cstat-no" title="statement not covered" >await detector.detect(frame);</span>
<span class="cstat-no" title="statement not covered" > if (codes.length &gt; 0) {</span>
<span class="cstat-no" title="statement not covered" > setResult({ code: codes[0].rawValue });</span>
} else {
<span class="cstat-no" title="statement not covered" > requestAnimationFrame(scan);</span>
}
};
<span class="cstat-no" title="statement not covered" > void scan();</span>
} else {
const controls = <span class="cstat-no" title="statement not covered" >await reader.decodeFromVideoDevice(</span>
undefined,
videoRef.current ?? undefined,
<span class="fstat-no" title="function not covered" > (d</span>ecoded) =&gt; {
<span class="cstat-no" title="statement not covered" > if (decoded) {</span>
<span class="cstat-no" title="statement not covered" > setResult({ code: decoded.getText() });</span>
}
},
);
<span class="cstat-no" title="statement not covered" > stop = <span class="fstat-no" title="function not covered" >() =&gt; <span class="cstat-no" title="statement not covered" >c</span>ontrols.stop();</span></span>
}
} catch (error) {
<span class="cstat-no" title="statement not covered" > setResult({ error: (error as Error).message });</span>
}
};
&nbsp;
<span class="cstat-no" title="statement not covered" > void start();</span>
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > active = false;</span>
<span class="cstat-no" title="statement not covered" > stop?.();</span>
const stream = <span class="cstat-no" title="statement not covered" >currentVideoElement?.srcObject as MediaStream | null;</span>
<span class="cstat-no" title="statement not covered" > if (stream) {</span>
<span class="cstat-no" title="statement not covered" > stream.getTracks().forEach(<span class="fstat-no" title="function not covered" >(t</span>rack) =&gt; <span class="cstat-no" title="statement not covered" >track.stop())</span>;</span>
}
};
}, []);
&nbsp;
<span class="cstat-no" title="statement not covered" > return { videoRef, result };</span>
};
&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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+176
View File
@@ -0,0 +1,176 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<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>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">72.86% </span>
<span class="quiet">Statements</span>
<span class='fraction'>298/409</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>152/228</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">76.57% </span>
<span class="quiet">Functions</span>
<span class='fraction'>85/111</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75.81% </span>
<span class="quiet">Lines</span>
<span class='fraction'>279/368</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="components"><a href="components/index.html">components</a></td>
<td data-value="70.9" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 70%"></div><div class="cover-empty" style="width: 30%"></div></div>
</td>
<td data-value="70.9" class="pct medium">70.9%</td>
<td data-value="55" class="abs medium">39/55</td>
<td data-value="65.62" class="pct medium">65.62%</td>
<td data-value="32" class="abs medium">21/32</td>
<td data-value="65.21" class="pct medium">65.21%</td>
<td data-value="23" class="abs medium">15/23</td>
<td data-value="69.56" class="pct medium">69.56%</td>
<td data-value="46" class="abs medium">32/46</td>
</tr>
<tr>
<td class="file low" data-value="hooks"><a href="hooks/index.html">hooks</a></td>
<td data-value="2.27" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 2%"></div><div class="cover-empty" style="width: 98%"></div></div>
</td>
<td data-value="2.27" class="pct low">2.27%</td>
<td data-value="44" class="abs low">1/44</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="20" class="abs low">0/20</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">0/8</td>
<td data-value="2.5" class="pct low">2.5%</td>
<td data-value="40" class="abs low">1/40</td>
</tr>
<tr>
<td class="file high" data-value="models"><a href="models/index.html">models</a></td>
<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="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="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
</tr>
<tr>
<td class="file high" data-value="modules"><a href="modules/index.html">modules</a></td>
<td data-value="80" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="20" class="abs high">16/20</td>
<td data-value="86.36" class="pct high">86.36%</td>
<td data-value="22" class="abs high">19/22</td>
<td data-value="66.66" class="pct medium">66.66%</td>
<td data-value="3" class="abs medium">2/3</td>
<td data-value="88.23" class="pct high">88.23%</td>
<td data-value="17" class="abs high">15/17</td>
</tr>
<tr>
<td class="file high" data-value="screens"><a href="screens/index.html">screens</a></td>
<td data-value="83.33" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 83%"></div><div class="cover-empty" style="width: 17%"></div></div>
</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="288" class="abs high">240/288</td>
<td data-value="72.72" class="pct medium">72.72%</td>
<td data-value="154" class="abs medium">112/154</td>
<td data-value="88.31" class="pct high">88.31%</td>
<td data-value="77" class="abs high">68/77</td>
<td data-value="87.07" class="pct high">87.07%</td>
<td data-value="263" class="abs high">229/263</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>
+127
View File
@@ -0,0 +1,127 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for models/Product.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">models</a> Product.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>2/2</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</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-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-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export interface Product {
id: string;
name: string;
category: string;
unit_type: string;
bulk_name?: string;
barcode?: string;
archived: boolean;
created_at: number;
updated_at: number;
}
&nbsp;
export const DEFAULT_UNIT_TYPE = 'unit';
export const DEFAULT_BULK_NAME = 'carton';
&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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+116
View File
@@ -0,0 +1,116 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for models</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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> models</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>2/2</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="Product.ts"><a href="Product.ts.html">Product.ts</a></td>
<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="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="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+116
View File
@@ -0,0 +1,116 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for modules</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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> modules</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">80% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.36% </span>
<span class="quiet">Branches</span>
<span class='fraction'>19/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.66% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.23% </span>
<span class="quiet">Lines</span>
<span class='fraction'>15/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="openFoodFacts.ts"><a href="openFoodFacts.ts.html">openFoodFacts.ts</a></td>
<td data-value="80" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="20" class="abs high">16/20</td>
<td data-value="86.36" class="pct high">86.36%</td>
<td data-value="22" class="abs high">19/22</td>
<td data-value="66.66" class="pct medium">66.66%</td>
<td data-value="3" class="abs medium">2/3</td>
<td data-value="88.23" class="pct high">88.23%</td>
<td data-value="17" class="abs high">15/17</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+244
View File
@@ -0,0 +1,244 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for modules/openFoodFacts.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">modules</a> openFoodFacts.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">80% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.36% </span>
<span class="quiet">Branches</span>
<span class='fraction'>19/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.66% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.23% </span>
<span class="quiet">Lines</span>
<span class='fraction'>15/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</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-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-yes">1x</span>
<span class="cline-any cline-yes">1x</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">1x</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-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">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>
<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-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<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-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-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-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">export interface ExternalProductInfo {
name: string | null;
brand?: string | null;
quantity?: string | null;
image?: string | null;
source: 'openfoodfacts';
}
&nbsp;
const BASE_URL = 'https://world.openfoodfacts.org/api/v2/product';
const REQUEST_TIMEOUT_MS = 5000;
&nbsp;
const isOffline = () =&gt; typeof navigator !== 'undefined' &amp;&amp; 'onLine' in navigator &amp;&amp; !navigator.onLine;
&nbsp;
export const fetchProductFromOFF = async (barcode: string): Promise&lt;ExternalProductInfo | null&gt; =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!barcode || isOffline()) {
<span class="cstat-no" title="statement not covered" > return null;</span>
}
&nbsp;
const controller = new AbortController();
const timeout = setTimeout(<span class="fstat-no" title="function not covered" >() =&gt; <span class="cstat-no" title="statement not covered" >c</span>ontroller.abort(), R</span>EQUEST_TIMEOUT_MS);
&nbsp;
try {
const response = await fetch(`${BASE_URL}/${barcode}.json`, { signal: controller.signal });
<span class="missing-if-branch" title="if path not taken" >I</span>if (!response.ok) <span class="cstat-no" title="statement not covered" >return null;</span>
&nbsp;
const data = (await response.json()) as {
status?: number;
product?: {
product_name?: string | null;
brands?: string | null;
quantity?: string | null;
image_url?: string | null;
};
};
&nbsp;
if (data?.status !== 1 || !data.product || !data.product.product_name) {
return null;
}
&nbsp;
return {
name: data.product.product_name ?? <span class="branch-1 cbranch-no" title="branch not covered" >null,</span>
brand: data.product.brands ?? null,
quantity: data.product.quantity ?? null,
image: data.product.image_url ?? null,
source: 'openfoodfacts',
} satisfies ExternalProductInfo;
} catch {
<span class="cstat-no" title="statement not covered" > return null;</span>
} finally {
clearTimeout(timeout);
}
};
&nbsp;
&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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,601 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for screens/ManageCategoriesScreen.tsx</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">screens</a> ManageCategoriesScreen.tsx</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">80.88% </span>
<span class="quiet">Statements</span>
<span class='fraction'>55/68</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60.71% </span>
<span class="quiet">Branches</span>
<span class='fraction'>17/28</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.11% </span>
<span class="quiet">Functions</span>
<span class='fraction'>16/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.48% </span>
<span class="quiet">Lines</span>
<span class='fraction'>53/62</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</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-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>
<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-yes">1x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</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">28x</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">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</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-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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">1x</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-no">&nbsp;</span>
<span class="cline-any cline-neutral">&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-yes">28x</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-yes">12x</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-yes">28x</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-yes">7x</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-yes">1x</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-yes">1x</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>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import {
Alert,
AlertColor,
Button,
Container,
IconButton,
List,
ListItem,
ListItemText,
Stack,
TextField,
Typography,
} from '@mui/material';
import CheckIcon from '@mui/icons-material/Check';
import CloseIcon from '@mui/icons-material/Close';
import DeleteIcon from '@mui/icons-material/Delete';
import EditIcon from '@mui/icons-material/Edit';
import { useMemo, useState } from 'react';
import { v4 as uuidv4 } from 'uuid';
import { useDatabase } from '../context/DBProvider';
import { useCategories, useProducts } from '../hooks/dataHooks';
&nbsp;
export const ManageCategoriesScreen = () =&gt; {
const db = useDatabase();
const categories = useCategories();
const products = useProducts();
const [name, setName] = useState('');
const [editingCategoryId, setEditingCategoryId] = useState&lt;string | null&gt;(null);
const [editName, setEditName] = useState('');
const [feedback, setFeedback] = useState&lt;{ text: string; severity: AlertColor } | null&gt;(null);
&nbsp;
const usageByCategory = useMemo(() =&gt; {
return products.reduce&lt;Record&lt;string, number&gt;&gt;((acc, product) =&gt; {
acc[product.category] = (acc[product.category] ?? 0) + 1;
return acc;
}, {});
}, [products]);
&nbsp;
const addCategory = async () =&gt; {
const trimmed = name.trim();
<span class="missing-if-branch" title="if path not taken" >I</span>if (!trimmed) <span class="cstat-no" title="statement not covered" >return;</span>
const exists = categories.some((category) =&gt; category.name.toLowerCase() === trimmed.toLowerCase());
if (exists) {
setFeedback({ text: 'A category with this name already exists.', severity: 'error' });
return;
}
await db.categories.add({ id: uuidv4(), name: trimmed, created_at: Date.now(), updated_at: Date.now() });
setName('');
setFeedback({ text: 'Category added.', severity: 'success' });
};
&nbsp;
const startEditing = (categoryId: string, currentName: string) =&gt; {
setEditingCategoryId(categoryId);
setEditName(currentName);
setFeedback(null);
};
&nbsp;
const saveCategory = async () =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!editingCategoryId) <span class="cstat-no" title="statement not covered" >return;</span>
const trimmed = editName.trim();
<span class="missing-if-branch" title="if path not taken" >I</span>if (!trimmed) <span class="cstat-no" title="statement not covered" >return;</span>
&nbsp;
const category = categories.find((item) =&gt; item.id === editingCategoryId);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!category) <span class="cstat-no" title="statement not covered" >return;</span>
&nbsp;
const nameExists = categories.some(
(item) =&gt; item.id !== editingCategoryId &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >item.name.toLowerCase() === trimmed.toLowerCase(),</span>
);
<span class="missing-if-branch" title="if path not taken" >I</span>if (nameExists) {
<span class="cstat-no" title="statement not covered" > setFeedback({ text: 'A category with this name already exists.', severity: 'error' });</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
await db.transaction('rw', db.categories, db.products, async () =&gt; {
await db.categories.update(editingCategoryId, { name: trimmed, updated_at: Date.now() });
await db.products
.where('category')
.equals(category.name)
.modify({ category: trimmed, updated_at: Date.now() });
});
&nbsp;
setEditingCategoryId(null);
setEditName('');
setFeedback({ text: 'Category updated. Linked products were refreshed.', severity: 'success' });
};
&nbsp;
const cancelEditing = <span class="fstat-no" title="function not covered" >() =&gt; {</span>
<span class="cstat-no" title="statement not covered" > setEditingCategoryId(null);</span>
<span class="cstat-no" title="statement not covered" > setEditName('');</span>
<span class="cstat-no" title="statement not covered" > setFeedback(null);</span>
};
&nbsp;
const deleteCategory = async (categoryId: string, categoryName: string) =&gt; {
const usageCount = usageByCategory[categoryName] ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
<span class="missing-if-branch" title="else path not taken" >E</span>if (usageCount &gt; 0) {
setFeedback({
text: `Cannot delete '${categoryName}' while ${usageCount} product(s) use it. Update those products first.`,
severity: 'error',
});
return;
}
<span class="cstat-no" title="statement not covered" > await db.categories.delete(categoryId);</span>
<span class="cstat-no" title="statement not covered" > if (editingCategoryId === categoryId) {</span>
<span class="cstat-no" title="statement not covered" > cancelEditing();</span>
}
<span class="cstat-no" title="statement not covered" > setFeedback({ text: 'Category deleted.', severity: 'success' });</span>
};
&nbsp;
return (
&lt;Container sx={{ py: 4 }}&gt;
&lt;Typography variant="h5" gutterBottom&gt;
Manage Categories
&lt;/Typography&gt;
&lt;Stack spacing={2}&gt;
{feedback ? &lt;Alert severity={feedback.severity}&gt;{feedback.text}&lt;/Alert&gt; : null}
&lt;Stack direction="row" spacing={1}&gt;
&lt;TextField
fullWidth
label="Category name"
value={name}
onChange={(event) =&gt; setName(event.target.value)}
/&gt;
&lt;Button variant="contained" onClick={addCategory} disabled={!name.trim()}&gt;
Add
&lt;/Button&gt;
&lt;/Stack&gt;
&lt;List&gt;
{categories.map((category) =&gt; (
&lt;ListItem key={category.id} divider&gt;
{editingCategoryId === category.id ? (
&lt;Stack direction="row" alignItems="center" spacing={1} sx={{ width: '100%' }}&gt;
&lt;TextField
size="small"
fullWidth
value={editName}
onChange={(event) =&gt; setEditName(event.target.value)}
/&gt;
&lt;IconButton color="primary" onClick={saveCategory} disabled={!editName.trim()} aria-label="Save category"&gt;
&lt;CheckIcon /&gt;
&lt;/IconButton&gt;
&lt;IconButton onClick={cancelEditing} aria-label="Cancel editing"&gt;
&lt;CloseIcon /&gt;
&lt;/IconButton&gt;
&lt;/Stack&gt;
) : (
&lt;Stack direction="row" alignItems="center" spacing={1} sx={{ width: '100%' }}&gt;
&lt;ListItemText primary={category.name} secondary={`Used by ${usageByCategory[category.name] ?? <span class="branch-1 cbranch-no" title="branch not covered" >0}</span> product(s)`} /&gt;
&lt;Stack direction="row" spacing={0.5}&gt;
&lt;IconButton
onClick={() =&gt; startEditing(category.id, category.name)}
aria-label={`Edit ${category.name}`}
size="small"
&gt;
&lt;EditIcon fontSize="small" /&gt;
&lt;/IconButton&gt;
&lt;IconButton
onClick={() =&gt; deleteCategory(category.id, category.name)}
aria-label={`Delete ${category.name}`}
size="small"
&gt;
&lt;DeleteIcon fontSize="small" /&gt;
&lt;/IconButton&gt;
&lt;/Stack&gt;
&lt;/Stack&gt;
)}
&lt;/ListItem&gt;
))}
&lt;/List&gt;
&lt;/Stack&gt;
&lt;/Container&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" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
File diff suppressed because it is too large Load Diff
+619
View File
@@ -0,0 +1,619 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for screens/PickListsScreen.tsx</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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">screens</a> PickListsScreen.tsx</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">94.54% </span>
<span class="quiet">Statements</span>
<span class='fraction'>52/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">65% </span>
<span class="quiet">Branches</span>
<span class='fraction'>13/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">97.95% </span>
<span class="quiet">Lines</span>
<span class='fraction'>48/49</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<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>
<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>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</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-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>
<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-yes">1x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">8x</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">8x</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-yes">66x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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-yes">22x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</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-yes">66x</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-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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>
<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>
<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-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">51x</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-yes">15x</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>
<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 {
Button,
Container,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
IconButton,
List,
ListItem,
ListItemButton,
ListItemText,
Stack,
TextField,
Typography,
} from '@mui/material';
import { Delete, Edit } from '@mui/icons-material';
import { format } from 'date-fns';
import { useMemo, useState } from 'react';
import { Link as RouterLink } from 'react-router-dom';
import { usePickLists, useAreas } from '../hooks/dataHooks';
import { useDatabase } from '../context/DBProvider';
import { PickList } from '../models/PickList';
&nbsp;
export const PickListsScreen = () =&gt; {
const lists = usePickLists();
const areas = useAreas();
const db = useDatabase();
const [editingList, setEditingList] = useState&lt;PickList | null&gt;(null);
const [areaId, setAreaId] = useState('');
const [notes, setNotes] = useState('');
&nbsp;
const areaNameById = useMemo(() =&gt; {
const map = new Map&lt;string, string&gt;();
areas.forEach((area) =&gt; map.set(area.id, area.name));
return map;
}, [areas]);
&nbsp;
const sortedLists = useMemo(() =&gt; {
const locale = new Intl.Collator(undefined, { sensitivity: 'base' });
const normalizeAreaName = (areaId: string) =&gt;
(areaNameById.get(areaId) ?? <span class="branch-1 cbranch-no" title="branch not covered" >'Unknown area').t</span>rim();
&nbsp;
return [...lists].sort((a, b) =&gt; {
const nameComparison = locale.compare(
normalizeAreaName(a.area_id),
normalizeAreaName(b.area_id),
);
<span class="missing-if-branch" title="else path not taken" >E</span>if (nameComparison !== 0) return nameComparison;
<span class="cstat-no" title="statement not covered" > return a.created_at - b.created_at;</span>
});
}, [areaNameById, lists]);
&nbsp;
const getAreaName = (areaId: string) =&gt; areaNameById.get(areaId) ?? <span class="branch-1 cbranch-no" title="branch not covered" >'Unknown area';</span>
&nbsp;
const openEdit = (list: PickList) =&gt; {
setEditingList(list);
setAreaId(list.area_id);
setNotes(list.notes ?? '');
};
&nbsp;
const closeEdit = () =&gt; {
setEditingList(null);
setAreaId('');
setNotes('');
};
&nbsp;
const saveEdit = async () =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!editingList || !areaId) <span class="cstat-no" title="statement not covered" >return;</span>
const listId = editingList.id;
const trimmedNotes = notes.trim() || <span class="branch-1 cbranch-no" title="branch not covered" >undefined;</span>
closeEdit();
await db.pickLists.update(listId, {
area_id: areaId,
notes: trimmedNotes,
});
};
&nbsp;
const deleteList = async (list: PickList) =&gt; {
const confirmed = window.confirm('Remove this pick list and its items?');
<span class="missing-if-branch" title="if path not taken" >I</span>if (!confirmed) <span class="cstat-no" title="statement not covered" >return;</span>
await db.pickItems.where('pick_list_id').equals(list.id).delete();
await db.pickLists.delete(list.id);
};
&nbsp;
return (
&lt;Container sx={{ py: 4 }}&gt;
&lt;Typography variant="h5" gutterBottom&gt;
Pick Lists
&lt;/Typography&gt;
&lt;Button component={RouterLink} to="/start" variant="contained" sx={{ mb: 2 }}&gt;
Add Pick List
&lt;/Button&gt;
&lt;List&gt;
{sortedLists.map((list) =&gt; (
&lt;ListItem key={list.id} divider secondaryAction={
&lt;Stack direction="row" spacing={1}&gt;
&lt;IconButton
edge="end"
aria-label="Edit"
onClick={(event) =&gt; {
event.stopPropagation();
event.preventDefault();
openEdit(list);
}}
&gt;
&lt;Edit /&gt;
&lt;/IconButton&gt;
&lt;IconButton
edge="end"
aria-label="Delete"
onClick={(event) =&gt; {
event.stopPropagation();
event.preventDefault();
deleteList(list);
}}
&gt;
&lt;Delete /&gt;
&lt;/IconButton&gt;
&lt;/Stack&gt;
}&gt;
&lt;ListItemButton component={RouterLink} to={`/pick-lists/${list.id}`}&gt;
&lt;ListItemText
primary={getAreaName(list.area_id)}
secondary={
&lt;Stack spacing={0.5}&gt;
{list.notes ? <span class="branch-0 cbranch-no" title="branch not covered" >&lt;span&gt;{list.notes}&lt;/span&gt; : n</span>ull}
&lt;Typography variant="caption" color="text.secondary"&gt;
Created {format(list.created_at, 'PPpp')}
&lt;/Typography&gt;
&lt;/Stack&gt;
}
secondaryTypographyProps={{ component: 'div' }}
/&gt;
&lt;/ListItemButton&gt;
&lt;/ListItem&gt;
))}
&lt;/List&gt;
&nbsp;
{editingList ? (
&lt;Dialog open onClose={closeEdit} fullWidth&gt;
&lt;DialogTitle&gt;Edit Pick List&lt;/DialogTitle&gt;
&lt;DialogContent sx={{ pt: 1 }}&gt;
&lt;Stack spacing={2} mt={1}&gt;
&lt;TextField
select
SelectProps={{ native: true }}
fullWidth
label="Area"
value={areaId}
onChange={(event) =&gt; setAreaId(event.target.value)}
&gt;
{areas.map((area) =&gt; (
&lt;option key={area.id} value={area.id}&gt;
{area.name}
&lt;/option&gt;
))}
&lt;/TextField&gt;
&lt;TextField
label="Notes"
value={notes}
onChange={(event) =&gt; setNotes(event.target.value)}
multiline
minRows={2}
/&gt;
&lt;/Stack&gt;
&lt;/DialogContent&gt;
&lt;DialogActions&gt;
&lt;Button onClick={closeEdit}&gt;Cancel&lt;/Button&gt;
&lt;Button variant="contained" onClick={saveEdit} disabled={!areaId}&gt;
Save Changes
&lt;/Button&gt;
&lt;/DialogActions&gt;
&lt;/Dialog&gt;
) : null}
&lt;/Container&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" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
+146
View File
@@ -0,0 +1,146 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for screens</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<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> screens</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">83.33% </span>
<span class="quiet">Statements</span>
<span class='fraction'>240/288</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.72% </span>
<span class="quiet">Branches</span>
<span class='fraction'>112/154</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.31% </span>
<span class="quiet">Functions</span>
<span class='fraction'>68/77</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.07% </span>
<span class="quiet">Lines</span>
<span class='fraction'>229/263</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="ManageCategoriesScreen.tsx"><a href="ManageCategoriesScreen.tsx.html">ManageCategoriesScreen.tsx</a></td>
<td data-value="80.88" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
</td>
<td data-value="80.88" class="pct high">80.88%</td>
<td data-value="68" class="abs high">55/68</td>
<td data-value="60.71" class="pct medium">60.71%</td>
<td data-value="28" class="abs medium">17/28</td>
<td data-value="94.11" class="pct high">94.11%</td>
<td data-value="17" class="abs high">16/17</td>
<td data-value="85.48" class="pct high">85.48%</td>
<td data-value="62" class="abs high">53/62</td>
</tr>
<tr>
<td class="file high" data-value="ManageProductsScreen.tsx"><a href="ManageProductsScreen.tsx.html">ManageProductsScreen.tsx</a></td>
<td data-value="80.6" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
</td>
<td data-value="80.6" class="pct high">80.6%</td>
<td data-value="165" class="abs high">133/165</td>
<td data-value="77.35" class="pct medium">77.35%</td>
<td data-value="106" class="abs medium">82/106</td>
<td data-value="81.39" class="pct high">81.39%</td>
<td data-value="43" class="abs high">35/43</td>
<td data-value="84.21" class="pct high">84.21%</td>
<td data-value="152" class="abs high">128/152</td>
</tr>
<tr>
<td class="file high" data-value="PickListsScreen.tsx"><a href="PickListsScreen.tsx.html">PickListsScreen.tsx</a></td>
<td data-value="94.54" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 94%"></div><div class="cover-empty" style="width: 6%"></div></div>
</td>
<td data-value="94.54" class="pct high">94.54%</td>
<td data-value="55" class="abs high">52/55</td>
<td data-value="65" class="pct medium">65%</td>
<td data-value="20" class="abs medium">13/20</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="97.95" class="pct high">97.95%</td>
<td data-value="49" class="abs high">48/49</td>
</tr>
</tbody>
</table>
</div>
<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 2025-11-24T10:28:53.968Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

+210
View File
@@ -0,0 +1,210 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
// it will be treated as a plain text search
let searchRegex;
try {
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
} catch (error) {
searchRegex = null;
}
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
let isMatch = false;
if (searchRegex) {
// If a valid regex was created, use it for matching
isMatch = searchRegex.test(row.textContent);
} else {
// Otherwise, fall back to the original plain text search
isMatch = row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase());
}
row.style.display = isMatch ? '' : 'none';
}
}
// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);