diff --git a/coverage/clover.xml b/coverage/clover.xml new file mode 100644 index 00000000..a797d598 --- /dev/null +++ b/coverage/clover.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/coverage/coverage-final.json @@ -0,0 +1 @@ +{} diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 00000000..f418035b --- /dev/null +++ b/coverage/lcov-report/base.css @@ -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; +} diff --git a/coverage/lcov-report/block-navigation.js b/coverage/lcov-report/block-navigation.js new file mode 100644 index 00000000..cc121302 --- /dev/null +++ b/coverage/lcov-report/block-navigation.js @@ -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) > ` + + // Selecter 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); diff --git a/coverage/lcov-report/favicon.png b/coverage/lcov-report/favicon.png new file mode 100644 index 00000000..c1525b81 Binary files /dev/null and b/coverage/lcov-report/favicon.png differ diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 00000000..c9efaf0b --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,101 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ Unknown% + Statements + 0/0 +
+ + +
+ Unknown% + Branches + 0/0 +
+ + +
+ Unknown% + Functions + 0/0 +
+ + +
+ Unknown% + Lines + 0/0 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -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} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 00000000..b3225238 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 00000000..6ed68316 Binary files /dev/null and b/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/coverage/lcov-report/sorter.js b/coverage/lcov-report/sorter.js new file mode 100644 index 00000000..2bb296a8 --- /dev/null +++ b/coverage/lcov-report/sorter.js @@ -0,0 +1,196 @@ +/* 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; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = '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 + ''; + } + } + 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); diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 00000000..e69de29b diff --git a/frontend/coverage/clover.xml b/frontend/coverage/clover.xml new file mode 100644 index 00000000..d613590a --- /dev/null +++ b/frontend/coverage/clover.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/coverage/coverage-final.json b/frontend/coverage/coverage-final.json new file mode 100644 index 00000000..78b282dc --- /dev/null +++ b/frontend/coverage/coverage-final.json @@ -0,0 +1,13 @@ +{"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/Modal/Modal.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/Modal/Modal.jsx","statementMap":{"0":{"start":{"line":3,"column":14},"end":{"line":43,"column":1}},"1":{"start":{"line":4,"column":24},"end":{"line":7,"column":5}},"2":{"start":{"line":5,"column":8},"end":{"line":5,"column":27}},"3":{"start":{"line":6,"column":8},"end":{"line":6,"column":21}},"4":{"start":{"line":9,"column":4},"end":{"line":42,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}},"loc":{"start":{"line":3,"column":34},"end":{"line":43,"column":1}},"line":3},"1":{"name":"(anonymous_1)","decl":{"start":{"line":4,"column":24},"end":{"line":4,"column":25}},"loc":{"start":{"line":4,"column":31},"end":{"line":7,"column":5}},"line":4}},"branchMap":{},"s":{"0":1,"1":6,"2":2,"3":2,"4":6},"f":{"0":6,"1":2},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"fe928621e36b462fc9c13ea48eea78c605b32dc5"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/Navbar/Navbar.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/Navbar/Navbar.jsx","statementMap":{"0":{"start":{"line":5,"column":2},"end":{"line":36,"column":4}}},"fnMap":{"0":{"name":"Navbar","decl":{"start":{"line":4,"column":9},"end":{"line":4,"column":15}},"loc":{"start":{"line":4,"column":18},"end":{"line":37,"column":1}},"line":4}},"branchMap":{},"s":{"0":3},"f":{"0":3},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"0a10eb118d0a9de7d590afb1e9d4573d4d448f76"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/UserNavbar/UserNavbar.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Components/UserNavbar/UserNavbar.jsx","statementMap":{"0":{"start":{"line":8,"column":27},"end":{"line":8,"column":38}},"1":{"start":{"line":10,"column":19},"end":{"line":10,"column":32}},"2":{"start":{"line":12,"column":23},"end":{"line":24,"column":3}},"3":{"start":{"line":13,"column":4},"end":{"line":23,"column":5}},"4":{"start":{"line":14,"column":23},"end":{"line":14,"column":69}},"5":{"start":{"line":16,"column":6},"end":{"line":20,"column":7}},"6":{"start":{"line":17,"column":8},"end":{"line":17,"column":22}},"7":{"start":{"line":19,"column":8},"end":{"line":19,"column":63}},"8":{"start":{"line":22,"column":6},"end":{"line":22,"column":51}},"9":{"start":{"line":26,"column":2},"end":{"line":75,"column":4}}},"fnMap":{"0":{"name":"UserNavbar","decl":{"start":{"line":7,"column":9},"end":{"line":7,"column":19}},"loc":{"start":{"line":7,"column":22},"end":{"line":76,"column":1}},"line":7},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":23},"end":{"line":12,"column":24}},"loc":{"start":{"line":12,"column":35},"end":{"line":24,"column":3}},"line":12}},"branchMap":{"0":{"loc":{"start":{"line":16,"column":6},"end":{"line":20,"column":7}},"type":"if","locations":[{"start":{"line":16,"column":6},"end":{"line":20,"column":7}},{"start":{"line":18,"column":13},"end":{"line":20,"column":7}}],"line":16}},"s":{"0":5,"1":5,"2":5,"3":2,"4":2,"5":2,"6":1,"7":1,"8":0,"9":5},"f":{"0":5,"1":2},"b":{"0":[1,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"a4e715746ccf9eeb207a84c756c425a0eff7e477"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Layout/PublicLayout.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Layout/PublicLayout.jsx","statementMap":{"0":{"start":{"line":5,"column":21},"end":{"line":12,"column":1}},"1":{"start":{"line":6,"column":4},"end":{"line":11,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":21},"end":{"line":5,"column":22}},"loc":{"start":{"line":5,"column":27},"end":{"line":12,"column":1}},"line":5}},"branchMap":{},"s":{"0":1,"1":2},"f":{"0":2},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"f05d6a64de3f9d2becaff670b3f319f55dcb19bb"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Layout/UserLayout.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/Layout/UserLayout.jsx","statementMap":{"0":{"start":{"line":5,"column":19},"end":{"line":12,"column":1}},"1":{"start":{"line":6,"column":4},"end":{"line":11,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":19},"end":{"line":5,"column":20}},"loc":{"start":{"line":5,"column":25},"end":{"line":12,"column":1}},"line":5}},"branchMap":{},"s":{"0":1,"1":1},"f":{"0":1},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"fb65f3d7fee0a71be260416feb0bd540b1b82f33"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/AboutPage/AboutPage.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/AboutPage/AboutPage.jsx","statementMap":{"0":{"start":{"line":5,"column":18},"end":{"line":60,"column":1}},"1":{"start":{"line":6,"column":4},"end":{"line":59,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":18},"end":{"line":5,"column":19}},"loc":{"start":{"line":5,"column":24},"end":{"line":60,"column":1}},"line":5}},"branchMap":{},"s":{"0":1,"1":6},"f":{"0":6},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"05c91723d2faea0213775628fd3366dfb13fa0f5"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/ChangePassword/ChangePassword.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/ChangePassword/ChangePassword.jsx","statementMap":{"0":{"start":{"line":6,"column":23},"end":{"line":121,"column":1}},"1":{"start":{"line":7,"column":27},"end":{"line":7,"column":38}},"2":{"start":{"line":13,"column":6},"end":{"line":13,"column":15}},"3":{"start":{"line":15,"column":21},"end":{"line":47,"column":3}},"4":{"start":{"line":16,"column":4},"end":{"line":16,"column":22}},"5":{"start":{"line":18,"column":16},"end":{"line":18,"column":53}},"6":{"start":{"line":20,"column":4},"end":{"line":46,"column":9}},"7":{"start":{"line":27,"column":21},"end":{"line":27,"column":31}},"8":{"start":{"line":29,"column":8},"end":{"line":29,"column":30}},"9":{"start":{"line":30,"column":8},"end":{"line":42,"column":9}},"10":{"start":{"line":31,"column":10},"end":{"line":34,"column":13}},"11":{"start":{"line":36,"column":10},"end":{"line":36,"column":50}},"12":{"start":{"line":37,"column":10},"end":{"line":41,"column":13}},"13":{"start":{"line":45,"column":8},"end":{"line":45,"column":23}},"14":{"start":{"line":49,"column":2},"end":{"line":120,"column":4}},"15":{"start":{"line":72,"column":20},"end":{"line":72,"column":60}},"16":{"start":{"line":91,"column":20},"end":{"line":91,"column":60}},"17":{"start":{"line":110,"column":20},"end":{"line":110,"column":60}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":6,"column":23},"end":{"line":6,"column":24}},"loc":{"start":{"line":6,"column":29},"end":{"line":121,"column":1}},"line":6},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":21},"end":{"line":15,"column":22}},"loc":{"start":{"line":15,"column":31},"end":{"line":47,"column":3}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":27,"column":12},"end":{"line":27,"column":13}},"loc":{"start":{"line":27,"column":21},"end":{"line":27,"column":31}},"line":27},"3":{"name":"(anonymous_3)","decl":{"start":{"line":28,"column":12},"end":{"line":28,"column":13}},"loc":{"start":{"line":28,"column":21},"end":{"line":43,"column":7}},"line":28},"4":{"name":"(anonymous_4)","decl":{"start":{"line":44,"column":13},"end":{"line":44,"column":14}},"loc":{"start":{"line":44,"column":20},"end":{"line":46,"column":7}},"line":44},"5":{"name":"(anonymous_5)","decl":{"start":{"line":71,"column":24},"end":{"line":71,"column":25}},"loc":{"start":{"line":72,"column":20},"end":{"line":72,"column":60}},"line":72},"6":{"name":"(anonymous_6)","decl":{"start":{"line":90,"column":24},"end":{"line":90,"column":25}},"loc":{"start":{"line":91,"column":20},"end":{"line":91,"column":60}},"line":91},"7":{"name":"(anonymous_7)","decl":{"start":{"line":109,"column":24},"end":{"line":109,"column":25}},"loc":{"start":{"line":110,"column":20},"end":{"line":110,"column":60}},"line":110}},"branchMap":{"0":{"loc":{"start":{"line":30,"column":8},"end":{"line":42,"column":9}},"type":"if","locations":[{"start":{"line":30,"column":8},"end":{"line":42,"column":9}},{"start":{"line":35,"column":15},"end":{"line":42,"column":9}}],"line":30}},"s":{"0":1,"1":3,"2":3,"3":3,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":0,"11":1,"12":1,"13":0,"14":3,"15":0,"16":0,"17":0},"f":{"0":3,"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0},"b":{"0":[0,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"2d4d0b1576ba2b0b845e7297b0cf9fc35aec3fae"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx","statementMap":{"0":{"start":{"line":5,"column":23},"end":{"line":284,"column":2}},"1":{"start":{"line":6,"column":19},"end":{"line":6,"column":31}},"2":{"start":{"line":7,"column":21},"end":{"line":7,"column":33}},"3":{"start":{"line":8,"column":42},"end":{"line":8,"column":56}},"4":{"start":{"line":9,"column":42},"end":{"line":9,"column":54}},"5":{"start":{"line":10,"column":42},"end":{"line":10,"column":54}},"6":{"start":{"line":12,"column":2},"end":{"line":203,"column":31}},"7":{"start":{"line":13,"column":4},"end":{"line":13,"column":27}},"8":{"start":{"line":13,"column":20},"end":{"line":13,"column":27}},"9":{"start":{"line":15,"column":4},"end":{"line":15,"column":57}},"10":{"start":{"line":17,"column":33},"end":{"line":19,"column":5}},"11":{"start":{"line":18,"column":38},"end":{"line":18,"column":51}},"12":{"start":{"line":20,"column":25},"end":{"line":25,"column":5}},"13":{"start":{"line":26,"column":27},"end":{"line":29,"column":10}},"14":{"start":{"line":27,"column":6},"end":{"line":27,"column":61}},"15":{"start":{"line":28,"column":6},"end":{"line":28,"column":17}},"16":{"start":{"line":31,"column":28},"end":{"line":33,"column":5}},"17":{"start":{"line":32,"column":6},"end":{"line":32,"column":42}},"18":{"start":{"line":35,"column":19},"end":{"line":35,"column":63}},"19":{"start":{"line":35,"column":49},"end":{"line":35,"column":62}},"20":{"start":{"line":37,"column":28},"end":{"line":43,"column":7}},"21":{"start":{"line":37,"column":59},"end":{"line":43,"column":5}},"22":{"start":{"line":45,"column":4},"end":{"line":45,"column":37}},"23":{"start":{"line":47,"column":21},"end":{"line":61,"column":5}},"24":{"start":{"line":50,"column":42},"end":{"line":50,"column":71}},"25":{"start":{"line":51,"column":52},"end":{"line":51,"column":59}},"26":{"start":{"line":53,"column":18},"end":{"line":53,"column":75}},"27":{"start":{"line":56,"column":18},"end":{"line":56,"column":50}},"28":{"start":{"line":63,"column":21},"end":{"line":72,"column":5}},"29":{"start":{"line":65,"column":35},"end":{"line":65,"column":63}},"30":{"start":{"line":74,"column":17},"end":{"line":77,"column":5}},"31":{"start":{"line":79,"column":16},"end":{"line":79,"column":49}},"32":{"start":{"line":81,"column":4},"end":{"line":83,"column":5}},"33":{"start":{"line":82,"column":6},"end":{"line":82,"column":35}},"34":{"start":{"line":85,"column":4},"end":{"line":202,"column":7}},"35":{"start":{"line":147,"column":16},"end":{"line":153,"column":20}},"36":{"start":{"line":147,"column":66},"end":{"line":153,"column":17}},"37":{"start":{"line":161,"column":29},"end":{"line":161,"column":67}},"38":{"start":{"line":162,"column":16},"end":{"line":166,"column":18}},"39":{"start":{"line":172,"column":10},"end":{"line":176,"column":11}},"40":{"start":{"line":173,"column":12},"end":{"line":173,"column":47}},"41":{"start":{"line":175,"column":12},"end":{"line":175,"column":34}},"42":{"start":{"line":183,"column":12},"end":{"line":183,"column":46}},"43":{"start":{"line":183,"column":39},"end":{"line":183,"column":46}},"44":{"start":{"line":185,"column":47},"end":{"line":185,"column":52}},"45":{"start":{"line":186,"column":24},"end":{"line":186,"column":66}},"46":{"start":{"line":187,"column":25},"end":{"line":187,"column":46}},"47":{"start":{"line":188,"column":26},"end":{"line":188,"column":47}},"48":{"start":{"line":190,"column":12},"end":{"line":190,"column":23}},"49":{"start":{"line":191,"column":12},"end":{"line":191,"column":55}},"50":{"start":{"line":192,"column":12},"end":{"line":197,"column":14}},"51":{"start":{"line":198,"column":12},"end":{"line":198,"column":26}},"52":{"start":{"line":205,"column":2},"end":{"line":264,"column":56}},"53":{"start":{"line":206,"column":26},"end":{"line":257,"column":5}},"54":{"start":{"line":207,"column":6},"end":{"line":207,"column":69}},"55":{"start":{"line":208,"column":6},"end":{"line":210,"column":7}},"56":{"start":{"line":209,"column":8},"end":{"line":209,"column":15}},"57":{"start":{"line":212,"column":6},"end":{"line":256,"column":7}},"58":{"start":{"line":213,"column":8},"end":{"line":213,"column":31}},"59":{"start":{"line":215,"column":26},"end":{"line":217,"column":30}},"60":{"start":{"line":219,"column":8},"end":{"line":255,"column":9}},"61":{"start":{"line":220,"column":10},"end":{"line":220,"column":37}},"62":{"start":{"line":221,"column":10},"end":{"line":230,"column":11}},"63":{"start":{"line":222,"column":26},"end":{"line":222,"column":44}},"64":{"start":{"line":224,"column":12},"end":{"line":224,"column":77}},"65":{"start":{"line":225,"column":12},"end":{"line":225,"column":27}},"66":{"start":{"line":227,"column":12},"end":{"line":227,"column":85}},"67":{"start":{"line":228,"column":12},"end":{"line":228,"column":35}},"68":{"start":{"line":229,"column":12},"end":{"line":229,"column":25}},"69":{"start":{"line":233,"column":10},"end":{"line":233,"column":43}},"70":{"start":{"line":236,"column":10},"end":{"line":247,"column":11}},"71":{"start":{"line":237,"column":12},"end":{"line":237,"column":39}},"72":{"start":{"line":238,"column":12},"end":{"line":246,"column":13}},"73":{"start":{"line":239,"column":28},"end":{"line":239,"column":46}},"74":{"start":{"line":240,"column":14},"end":{"line":240,"column":79}},"75":{"start":{"line":241,"column":14},"end":{"line":241,"column":29}},"76":{"start":{"line":243,"column":14},"end":{"line":243,"column":87}},"77":{"start":{"line":244,"column":14},"end":{"line":244,"column":37}},"78":{"start":{"line":245,"column":14},"end":{"line":245,"column":27}},"79":{"start":{"line":249,"column":21},"end":{"line":249,"column":51}},"80":{"start":{"line":250,"column":39},"end":{"line":250,"column":65}},"81":{"start":{"line":251,"column":10},"end":{"line":254,"column":11}},"82":{"start":{"line":252,"column":12},"end":{"line":252,"column":41}},"83":{"start":{"line":253,"column":12},"end":{"line":253,"column":44}},"84":{"start":{"line":253,"column":35},"end":{"line":253,"column":42}},"85":{"start":{"line":259,"column":4},"end":{"line":259,"column":54}},"86":{"start":{"line":261,"column":4},"end":{"line":263,"column":6}},"87":{"start":{"line":262,"column":6},"end":{"line":262,"column":59}},"88":{"start":{"line":268,"column":2},"end":{"line":275,"column":6}},"89":{"start":{"line":268,"column":34},"end":{"line":275,"column":3}},"90":{"start":{"line":270,"column":19},"end":{"line":270,"column":46}},"91":{"start":{"line":271,"column":6},"end":{"line":271,"column":58}},"92":{"start":{"line":272,"column":6},"end":{"line":272,"column":34}},"93":{"start":{"line":273,"column":6},"end":{"line":273,"column":19}},"94":{"start":{"line":277,"column":2},"end":{"line":283,"column":4}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":34},"end":{"line":5,"column":35}},"loc":{"start":{"line":5,"column":71},"end":{"line":284,"column":1}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":12},"end":{"line":12,"column":13}},"loc":{"start":{"line":12,"column":18},"end":{"line":203,"column":3}},"line":12},"2":{"name":"(anonymous_2)","decl":{"start":{"line":18,"column":28},"end":{"line":18,"column":29}},"loc":{"start":{"line":18,"column":38},"end":{"line":18,"column":51}},"line":18},"3":{"name":"(anonymous_3)","decl":{"start":{"line":26,"column":55},"end":{"line":26,"column":56}},"loc":{"start":{"line":26,"column":78},"end":{"line":29,"column":5}},"line":26},"4":{"name":"(anonymous_4)","decl":{"start":{"line":31,"column":48},"end":{"line":31,"column":49}},"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":42}},"line":32},"5":{"name":"(anonymous_5)","decl":{"start":{"line":35,"column":39},"end":{"line":35,"column":40}},"loc":{"start":{"line":35,"column":49},"end":{"line":35,"column":62}},"line":35},"6":{"name":"(anonymous_6)","decl":{"start":{"line":37,"column":48},"end":{"line":37,"column":49}},"loc":{"start":{"line":37,"column":59},"end":{"line":43,"column":5}},"line":37},"7":{"name":"(anonymous_7)","decl":{"start":{"line":50,"column":34},"end":{"line":50,"column":35}},"loc":{"start":{"line":50,"column":42},"end":{"line":50,"column":71}},"line":50},"8":{"name":"(anonymous_8)","decl":{"start":{"line":51,"column":45},"end":{"line":51,"column":46}},"loc":{"start":{"line":51,"column":52},"end":{"line":51,"column":59}},"line":51},"9":{"name":"(anonymous_9)","decl":{"start":{"line":53,"column":10},"end":{"line":53,"column":11}},"loc":{"start":{"line":53,"column":18},"end":{"line":53,"column":75}},"line":53},"10":{"name":"(anonymous_10)","decl":{"start":{"line":56,"column":10},"end":{"line":56,"column":11}},"loc":{"start":{"line":56,"column":18},"end":{"line":56,"column":50}},"line":56},"11":{"name":"(anonymous_11)","decl":{"start":{"line":65,"column":23},"end":{"line":65,"column":24}},"loc":{"start":{"line":65,"column":35},"end":{"line":65,"column":63}},"line":65},"12":{"name":"(anonymous_12)","decl":{"start":{"line":146,"column":30},"end":{"line":146,"column":31}},"loc":{"start":{"line":146,"column":36},"end":{"line":154,"column":15}},"line":146},"13":{"name":"(anonymous_13)","decl":{"start":{"line":147,"column":48},"end":{"line":147,"column":49}},"loc":{"start":{"line":147,"column":66},"end":{"line":153,"column":17}},"line":147},"14":{"name":"(anonymous_14)","decl":{"start":{"line":160,"column":21},"end":{"line":160,"column":22}},"loc":{"start":{"line":160,"column":38},"end":{"line":167,"column":15}},"line":160},"15":{"name":"(anonymous_15)","decl":{"start":{"line":171,"column":17},"end":{"line":171,"column":18}},"loc":{"start":{"line":171,"column":38},"end":{"line":177,"column":9}},"line":171},"16":{"name":"(anonymous_16)","decl":{"start":{"line":182,"column":21},"end":{"line":182,"column":22}},"loc":{"start":{"line":182,"column":32},"end":{"line":199,"column":11}},"line":182},"17":{"name":"(anonymous_17)","decl":{"start":{"line":205,"column":12},"end":{"line":205,"column":13}},"loc":{"start":{"line":205,"column":18},"end":{"line":264,"column":3}},"line":205},"18":{"name":"(anonymous_18)","decl":{"start":{"line":206,"column":26},"end":{"line":206,"column":27}},"loc":{"start":{"line":206,"column":37},"end":{"line":257,"column":5}},"line":206},"19":{"name":"(anonymous_19)","decl":{"start":{"line":253,"column":28},"end":{"line":253,"column":29}},"loc":{"start":{"line":253,"column":35},"end":{"line":253,"column":42}},"line":253},"20":{"name":"(anonymous_20)","decl":{"start":{"line":261,"column":11},"end":{"line":261,"column":12}},"loc":{"start":{"line":261,"column":17},"end":{"line":263,"column":5}},"line":261},"21":{"name":"(anonymous_21)","decl":{"start":{"line":268,"column":27},"end":{"line":268,"column":28}},"loc":{"start":{"line":268,"column":34},"end":{"line":275,"column":3}},"line":268},"22":{"name":"(anonymous_22)","decl":{"start":{"line":269,"column":4},"end":{"line":269,"column":5}},"loc":{"start":{"line":269,"column":20},"end":{"line":274,"column":5}},"line":269}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":27}},"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":13,"column":27}},{"start":{},"end":{}}],"line":13},"1":{"loc":{"start":{"line":42,"column":13},"end":{"line":42,"column":72}},"type":"binary-expr","locations":[{"start":{"line":42,"column":13},"end":{"line":42,"column":42}},{"start":{"line":42,"column":46},"end":{"line":42,"column":72}}],"line":42},"2":{"loc":{"start":{"line":53,"column":18},"end":{"line":53,"column":75}},"type":"cond-expr","locations":[{"start":{"line":53,"column":45},"end":{"line":53,"column":65}},{"start":{"line":53,"column":68},"end":{"line":53,"column":75}}],"line":53},"3":{"loc":{"start":{"line":56,"column":18},"end":{"line":56,"column":50}},"type":"cond-expr","locations":[{"start":{"line":56,"column":45},"end":{"line":56,"column":46}},{"start":{"line":56,"column":49},"end":{"line":56,"column":50}}],"line":56},"4":{"loc":{"start":{"line":81,"column":4},"end":{"line":83,"column":5}},"type":"if","locations":[{"start":{"line":81,"column":4},"end":{"line":83,"column":5}},{"start":{},"end":{}}],"line":81},"5":{"loc":{"start":{"line":172,"column":10},"end":{"line":176,"column":11}},"type":"if","locations":[{"start":{"line":172,"column":10},"end":{"line":176,"column":11}},{"start":{"line":174,"column":17},"end":{"line":176,"column":11}}],"line":172},"6":{"loc":{"start":{"line":183,"column":12},"end":{"line":183,"column":46}},"type":"if","locations":[{"start":{"line":183,"column":12},"end":{"line":183,"column":46}},{"start":{},"end":{}}],"line":183},"7":{"loc":{"start":{"line":208,"column":6},"end":{"line":210,"column":7}},"type":"if","locations":[{"start":{"line":208,"column":6},"end":{"line":210,"column":7}},{"start":{},"end":{}}],"line":208},"8":{"loc":{"start":{"line":212,"column":6},"end":{"line":256,"column":7}},"type":"if","locations":[{"start":{"line":212,"column":6},"end":{"line":256,"column":7}},{"start":{},"end":{}}],"line":212},"9":{"loc":{"start":{"line":215,"column":26},"end":{"line":217,"column":30}},"type":"cond-expr","locations":[{"start":{"line":216,"column":12},"end":{"line":216,"column":13}},{"start":{"line":217,"column":13},"end":{"line":217,"column":29}}],"line":215},"10":{"loc":{"start":{"line":219,"column":8},"end":{"line":255,"column":9}},"type":"if","locations":[{"start":{"line":219,"column":8},"end":{"line":255,"column":9}},{"start":{"line":231,"column":15},"end":{"line":255,"column":9}}],"line":219},"11":{"loc":{"start":{"line":221,"column":10},"end":{"line":230,"column":11}},"type":"if","locations":[{"start":{"line":221,"column":10},"end":{"line":230,"column":11}},{"start":{},"end":{}}],"line":221},"12":{"loc":{"start":{"line":236,"column":10},"end":{"line":247,"column":11}},"type":"if","locations":[{"start":{"line":236,"column":10},"end":{"line":247,"column":11}},{"start":{},"end":{}}],"line":236},"13":{"loc":{"start":{"line":238,"column":12},"end":{"line":246,"column":13}},"type":"if","locations":[{"start":{"line":238,"column":12},"end":{"line":246,"column":13}},{"start":{},"end":{}}],"line":238},"14":{"loc":{"start":{"line":251,"column":10},"end":{"line":254,"column":11}},"type":"if","locations":[{"start":{"line":251,"column":10},"end":{"line":254,"column":11}},{"start":{},"end":{}}],"line":251}},"s":{"0":2,"1":8,"2":8,"3":8,"4":8,"5":8,"6":8,"7":4,"8":0,"9":4,"10":4,"11":8,"12":4,"13":4,"14":8,"15":8,"16":4,"17":4,"18":4,"19":8,"20":4,"21":8,"22":4,"23":4,"24":8,"25":8,"26":8,"27":8,"28":4,"29":8,"30":4,"31":4,"32":4,"33":1,"34":4,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":8,"53":6,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":6,"86":6,"87":6,"88":8,"89":2,"90":1,"91":1,"92":1,"93":1,"94":8},"f":{"0":8,"1":4,"2":8,"3":8,"4":4,"5":8,"6":8,"7":8,"8":8,"9":8,"10":8,"11":8,"12":0,"13":0,"14":0,"15":0,"16":0,"17":6,"18":0,"19":0,"20":6,"21":2,"22":1},"b":{"0":[0,4],"1":[8,0],"2":[3,5],"3":[3,5],"4":[1,3],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"7eb572dd6bf6ed45d7837cbfebab36cb095635d9"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/DashboardPage/data/graphDataDefault.js": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/DashboardPage/data/graphDataDefault.js","statementMap":{"0":{"start":{"line":1,"column":25},"end":{"line":114,"column":1}}},"fnMap":{},"branchMap":{},"s":{"0":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"13bf135cd369e38fdfb99473c301538af050e820"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/SharePage/SharePage.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/SharePage/SharePage.jsx","statementMap":{"0":{"start":{"line":9,"column":18},"end":{"line":156,"column":1}},"1":{"start":{"line":10,"column":29},"end":{"line":10,"column":38}},"2":{"start":{"line":11,"column":28},"end":{"line":11,"column":39}},"3":{"start":{"line":12,"column":21},"end":{"line":12,"column":33}},"4":{"start":{"line":14,"column":28},"end":{"line":14,"column":42}},"5":{"start":{"line":15,"column":34},"end":{"line":15,"column":48}},"6":{"start":{"line":16,"column":30},"end":{"line":16,"column":44}},"7":{"start":{"line":17,"column":42},"end":{"line":17,"column":56}},"8":{"start":{"line":18,"column":38},"end":{"line":18,"column":64}},"9":{"start":{"line":20,"column":4},"end":{"line":59,"column":22}},"10":{"start":{"line":21,"column":8},"end":{"line":58,"column":9}},"11":{"start":{"line":22,"column":12},"end":{"line":22,"column":29}},"12":{"start":{"line":23,"column":12},"end":{"line":54,"column":19}},"13":{"start":{"line":27,"column":20},"end":{"line":29,"column":21}},"14":{"start":{"line":28,"column":24},"end":{"line":28,"column":64}},"15":{"start":{"line":30,"column":20},"end":{"line":30,"column":43}},"16":{"start":{"line":34,"column":20},"end":{"line":36,"column":21}},"17":{"start":{"line":35,"column":24},"end":{"line":35,"column":63}},"18":{"start":{"line":37,"column":20},"end":{"line":39,"column":21}},"19":{"start":{"line":38,"column":24},"end":{"line":38,"column":72}},"20":{"start":{"line":40,"column":20},"end":{"line":40,"column":45}},"21":{"start":{"line":41,"column":20},"end":{"line":41,"column":38}},"22":{"start":{"line":43,"column":20},"end":{"line":46,"column":21}},"23":{"start":{"line":44,"column":24},"end":{"line":44,"column":121}},"24":{"start":{"line":45,"column":24},"end":{"line":45,"column":31}},"25":{"start":{"line":48,"column":20},"end":{"line":48,"column":50}},"26":{"start":{"line":49,"column":20},"end":{"line":49,"column":58}},"27":{"start":{"line":52,"column":20},"end":{"line":52,"column":44}},"28":{"start":{"line":53,"column":20},"end":{"line":53,"column":38}},"29":{"start":{"line":56,"column":12},"end":{"line":56,"column":54}},"30":{"start":{"line":57,"column":12},"end":{"line":57,"column":30}},"31":{"start":{"line":61,"column":33},"end":{"line":73,"column":5}},"32":{"start":{"line":62,"column":8},"end":{"line":64,"column":9}},"33":{"start":{"line":63,"column":12},"end":{"line":63,"column":78}},"34":{"start":{"line":67,"column":30},"end":{"line":67,"column":80}},"35":{"start":{"line":67,"column":57},"end":{"line":67,"column":76}},"36":{"start":{"line":70,"column":32},"end":{"line":70,"column":59}},"37":{"start":{"line":72,"column":8},"end":{"line":72,"column":63}},"38":{"start":{"line":75,"column":21},"end":{"line":85,"column":5}},"39":{"start":{"line":76,"column":32},"end":{"line":76,"column":41}},"40":{"start":{"line":78,"column":8},"end":{"line":83,"column":9}},"41":{"start":{"line":79,"column":35},"end":{"line":79,"column":52}},"42":{"start":{"line":80,"column":12},"end":{"line":82,"column":13}},"43":{"start":{"line":81,"column":16},"end":{"line":81,"column":51}},"44":{"start":{"line":84,"column":8},"end":{"line":84,"column":33}},"45":{"start":{"line":87,"column":4},"end":{"line":154,"column":6}},"46":{"start":{"line":133,"column":44},"end":{"line":133,"column":72}},"47":{"start":{"line":145,"column":44},"end":{"line":145,"column":72}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":9,"column":18},"end":{"line":9,"column":19}},"loc":{"start":{"line":9,"column":24},"end":{"line":156,"column":1}},"line":9},"1":{"name":"(anonymous_1)","decl":{"start":{"line":20,"column":14},"end":{"line":20,"column":15}},"loc":{"start":{"line":20,"column":20},"end":{"line":59,"column":5}},"line":20},"2":{"name":"(anonymous_2)","decl":{"start":{"line":26,"column":22},"end":{"line":26,"column":23}},"loc":{"start":{"line":26,"column":36},"end":{"line":31,"column":17}},"line":26},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":22},"end":{"line":32,"column":23}},"loc":{"start":{"line":32,"column":32},"end":{"line":50,"column":17}},"line":32},"4":{"name":"(anonymous_4)","decl":{"start":{"line":51,"column":23},"end":{"line":51,"column":24}},"loc":{"start":{"line":51,"column":34},"end":{"line":54,"column":17}},"line":51},"5":{"name":"(anonymous_5)","decl":{"start":{"line":61,"column":33},"end":{"line":61,"column":34}},"loc":{"start":{"line":61,"column":43},"end":{"line":73,"column":5}},"line":61},"6":{"name":"(anonymous_6)","decl":{"start":{"line":67,"column":42},"end":{"line":67,"column":43}},"loc":{"start":{"line":67,"column":57},"end":{"line":67,"column":76}},"line":67},"7":{"name":"(anonymous_7)","decl":{"start":{"line":75,"column":21},"end":{"line":75,"column":22}},"loc":{"start":{"line":75,"column":27},"end":{"line":85,"column":5}},"line":75},"8":{"name":"(anonymous_8)","decl":{"start":{"line":132,"column":64},"end":{"line":132,"column":65}},"loc":{"start":{"line":133,"column":44},"end":{"line":133,"column":72}},"line":133},"9":{"name":"(anonymous_9)","decl":{"start":{"line":144,"column":70},"end":{"line":144,"column":71}},"loc":{"start":{"line":145,"column":44},"end":{"line":145,"column":72}},"line":145}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":8},"end":{"line":58,"column":9}},"type":"if","locations":[{"start":{"line":21,"column":8},"end":{"line":58,"column":9}},{"start":{"line":55,"column":15},"end":{"line":58,"column":9}}],"line":21},"1":{"loc":{"start":{"line":27,"column":20},"end":{"line":29,"column":21}},"type":"if","locations":[{"start":{"line":27,"column":20},"end":{"line":29,"column":21}},{"start":{},"end":{}}],"line":27},"2":{"loc":{"start":{"line":34,"column":20},"end":{"line":36,"column":21}},"type":"if","locations":[{"start":{"line":34,"column":20},"end":{"line":36,"column":21}},{"start":{},"end":{}}],"line":34},"3":{"loc":{"start":{"line":34,"column":24},"end":{"line":34,"column":60}},"type":"binary-expr","locations":[{"start":{"line":34,"column":24},"end":{"line":34,"column":40}},{"start":{"line":34,"column":44},"end":{"line":34,"column":60}}],"line":34},"4":{"loc":{"start":{"line":37,"column":20},"end":{"line":39,"column":21}},"type":"if","locations":[{"start":{"line":37,"column":20},"end":{"line":39,"column":21}},{"start":{},"end":{}}],"line":37},"5":{"loc":{"start":{"line":37,"column":24},"end":{"line":37,"column":198}},"type":"binary-expr","locations":[{"start":{"line":37,"column":24},"end":{"line":37,"column":49}},{"start":{"line":37,"column":53},"end":{"line":37,"column":79}},{"start":{"line":37,"column":83},"end":{"line":37,"column":119}},{"start":{"line":37,"column":123},"end":{"line":37,"column":154}},{"start":{"line":37,"column":158},"end":{"line":37,"column":198}}],"line":37},"6":{"loc":{"start":{"line":43,"column":20},"end":{"line":46,"column":21}},"type":"if","locations":[{"start":{"line":43,"column":20},"end":{"line":46,"column":21}},{"start":{},"end":{}}],"line":43},"7":{"loc":{"start":{"line":62,"column":8},"end":{"line":64,"column":9}},"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":64,"column":9}},{"start":{},"end":{}}],"line":62},"8":{"loc":{"start":{"line":62,"column":12},"end":{"line":62,"column":53}},"type":"binary-expr","locations":[{"start":{"line":62,"column":12},"end":{"line":62,"column":32}},{"start":{"line":62,"column":36},"end":{"line":62,"column":53}}],"line":62},"9":{"loc":{"start":{"line":80,"column":12},"end":{"line":82,"column":13}},"type":"if","locations":[{"start":{"line":80,"column":12},"end":{"line":82,"column":13}},{"start":{},"end":{}}],"line":80},"10":{"loc":{"start":{"line":89,"column":13},"end":{"line":152,"column":13}},"type":"cond-expr","locations":[{"start":{"line":90,"column":16},"end":{"line":90,"column":58}},{"start":{"line":91,"column":16},"end":{"line":152,"column":13}}],"line":89},"11":{"loc":{"start":{"line":91,"column":16},"end":{"line":152,"column":13}},"type":"cond-expr","locations":[{"start":{"line":92,"column":16},"end":{"line":92,"column":56}},{"start":{"line":94,"column":16},"end":{"line":151,"column":22}}],"line":91},"12":{"loc":{"start":{"line":103,"column":49},"end":{"line":103,"column":90}},"type":"cond-expr","locations":[{"start":{"line":103,"column":69},"end":{"line":103,"column":78}},{"start":{"line":103,"column":81},"end":{"line":103,"column":90}}],"line":103},"13":{"loc":{"start":{"line":112,"column":29},"end":{"line":119,"column":29}},"type":"binary-expr","locations":[{"start":{"line":112,"column":29},"end":{"line":112,"column":38}},{"start":{"line":112,"column":42},"end":{"line":112,"column":75}},{"start":{"line":113,"column":32},"end":{"line":118,"column":34}}],"line":112},"14":{"loc":{"start":{"line":131,"column":37},"end":{"line":134,"column":42}},"type":"binary-expr","locations":[{"start":{"line":131,"column":37},"end":{"line":131,"column":56}},{"start":{"line":132,"column":40},"end":{"line":134,"column":42}}],"line":131},"15":{"loc":{"start":{"line":143,"column":37},"end":{"line":146,"column":42}},"type":"binary-expr","locations":[{"start":{"line":143,"column":37},"end":{"line":143,"column":62}},{"start":{"line":144,"column":40},"end":{"line":146,"column":42}}],"line":143}},"s":{"0":1,"1":6,"2":6,"3":6,"4":6,"5":6,"6":6,"7":6,"8":6,"9":6,"10":3,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":3,"30":3,"31":6,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":6,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":6,"46":0,"47":0},"f":{"0":6,"1":3,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"b":{"0":[0,3],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0,0,0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[3,3],"11":[3,0],"12":[0,0],"13":[0,0,0],"14":[0,0],"15":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"9f090b4482927ce5f96dc3a999f936e88865a787"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/UserLogin/UserLogin.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/UserLogin/UserLogin.jsx","statementMap":{"0":{"start":{"line":10,"column":18},"end":{"line":131,"column":1}},"1":{"start":{"line":11,"column":19},"end":{"line":11,"column":32}},"2":{"start":{"line":12,"column":27},"end":{"line":12,"column":38}},"3":{"start":{"line":14,"column":2},"end":{"line":22,"column":9}},"4":{"start":{"line":15,"column":26},"end":{"line":15,"column":63}},"5":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},"6":{"start":{"line":18,"column":6},"end":{"line":18,"column":21}},"7":{"start":{"line":21,"column":4},"end":{"line":21,"column":45}},"8":{"start":{"line":24,"column":23},"end":{"line":36,"column":3}},"9":{"start":{"line":25,"column":4},"end":{"line":35,"column":5}},"10":{"start":{"line":26,"column":23},"end":{"line":26,"column":69}},"11":{"start":{"line":28,"column":6},"end":{"line":32,"column":7}},"12":{"start":{"line":29,"column":8},"end":{"line":29,"column":22}},"13":{"start":{"line":31,"column":8},"end":{"line":31,"column":63}},"14":{"start":{"line":34,"column":6},"end":{"line":34,"column":51}},"15":{"start":{"line":42,"column":6},"end":{"line":42,"column":15}},"16":{"start":{"line":44,"column":21},"end":{"line":81,"column":3}},"17":{"start":{"line":45,"column":4},"end":{"line":45,"column":22}},"18":{"start":{"line":47,"column":16},"end":{"line":47,"column":43}},"19":{"start":{"line":49,"column":4},"end":{"line":80,"column":9}},"20":{"start":{"line":56,"column":21},"end":{"line":56,"column":31}},"21":{"start":{"line":58,"column":8},"end":{"line":58,"column":30}},"22":{"start":{"line":59,"column":8},"end":{"line":76,"column":9}},"23":{"start":{"line":60,"column":10},"end":{"line":63,"column":13}},"24":{"start":{"line":65,"column":10},"end":{"line":65,"column":50}},"25":{"start":{"line":66,"column":10},"end":{"line":75,"column":15}},"26":{"start":{"line":73,"column":14},"end":{"line":73,"column":46}},"27":{"start":{"line":74,"column":14},"end":{"line":74,"column":37}},"28":{"start":{"line":79,"column":8},"end":{"line":79,"column":23}},"29":{"start":{"line":83,"column":2},"end":{"line":130,"column":4}},"30":{"start":{"line":104,"column":16},"end":{"line":104,"column":58}},"31":{"start":{"line":121,"column":16},"end":{"line":121,"column":58}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":18},"end":{"line":10,"column":19}},"loc":{"start":{"line":10,"column":24},"end":{"line":131,"column":1}},"line":10},"1":{"name":"(anonymous_1)","decl":{"start":{"line":14,"column":12},"end":{"line":14,"column":13}},"loc":{"start":{"line":14,"column":18},"end":{"line":22,"column":3}},"line":14},"2":{"name":"(anonymous_2)","decl":{"start":{"line":24,"column":23},"end":{"line":24,"column":24}},"loc":{"start":{"line":24,"column":35},"end":{"line":36,"column":3}},"line":24},"3":{"name":"(anonymous_3)","decl":{"start":{"line":44,"column":21},"end":{"line":44,"column":22}},"loc":{"start":{"line":44,"column":31},"end":{"line":81,"column":3}},"line":44},"4":{"name":"(anonymous_4)","decl":{"start":{"line":56,"column":12},"end":{"line":56,"column":13}},"loc":{"start":{"line":56,"column":21},"end":{"line":56,"column":31}},"line":56},"5":{"name":"(anonymous_5)","decl":{"start":{"line":57,"column":12},"end":{"line":57,"column":13}},"loc":{"start":{"line":57,"column":21},"end":{"line":77,"column":7}},"line":57},"6":{"name":"(anonymous_6)","decl":{"start":{"line":72,"column":18},"end":{"line":72,"column":19}},"loc":{"start":{"line":72,"column":24},"end":{"line":75,"column":13}},"line":72},"7":{"name":"(anonymous_7)","decl":{"start":{"line":78,"column":13},"end":{"line":78,"column":14}},"loc":{"start":{"line":78,"column":20},"end":{"line":80,"column":7}},"line":78},"8":{"name":"(anonymous_8)","decl":{"start":{"line":103,"column":22},"end":{"line":103,"column":23}},"loc":{"start":{"line":104,"column":16},"end":{"line":104,"column":58}},"line":104},"9":{"name":"(anonymous_9)","decl":{"start":{"line":120,"column":22},"end":{"line":120,"column":23}},"loc":{"start":{"line":121,"column":16},"end":{"line":121,"column":58}},"line":121}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},"type":"if","locations":[{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},{"start":{},"end":{}}],"line":17},"1":{"loc":{"start":{"line":17,"column":8},"end":{"line":17,"column":49}},"type":"binary-expr","locations":[{"start":{"line":17,"column":8},"end":{"line":17,"column":21}},{"start":{"line":17,"column":25},"end":{"line":17,"column":49}}],"line":17},"2":{"loc":{"start":{"line":28,"column":6},"end":{"line":32,"column":7}},"type":"if","locations":[{"start":{"line":28,"column":6},"end":{"line":32,"column":7}},{"start":{"line":30,"column":13},"end":{"line":32,"column":7}}],"line":28},"3":{"loc":{"start":{"line":59,"column":8},"end":{"line":76,"column":9}},"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":76,"column":9}},{"start":{"line":64,"column":15},"end":{"line":76,"column":9}}],"line":59}},"s":{"0":1,"1":7,"2":7,"3":7,"4":4,"5":4,"6":0,"7":4,"8":7,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":7,"16":7,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":1,"24":1,"25":1,"26":0,"27":0,"28":0,"29":7,"30":1,"31":1},"f":{"0":7,"1":4,"2":0,"3":2,"4":2,"5":2,"6":0,"7":0,"8":1,"9":1},"b":{"0":[0,4],"1":[4,0],"2":[0,0],"3":[1,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"6b02fd42a6e1e219bb2ebf2d353d794c5a1104d9"} +,"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/UserSignup/UserSignup.jsx": {"path":"/Users/navnoorsinghmahal/WebstormProjects/Cash-App-Bias-Busters1/frontend/src/pages/UserSignup/UserSignup.jsx","statementMap":{"0":{"start":{"line":11,"column":19},"end":{"line":205,"column":1}},"1":{"start":{"line":12,"column":27},"end":{"line":12,"column":38}},"2":{"start":{"line":14,"column":19},"end":{"line":14,"column":32}},"3":{"start":{"line":16,"column":2},"end":{"line":24,"column":9}},"4":{"start":{"line":17,"column":26},"end":{"line":17,"column":63}},"5":{"start":{"line":19,"column":4},"end":{"line":21,"column":5}},"6":{"start":{"line":20,"column":6},"end":{"line":20,"column":21}},"7":{"start":{"line":23,"column":4},"end":{"line":23,"column":45}},"8":{"start":{"line":26,"column":23},"end":{"line":38,"column":3}},"9":{"start":{"line":27,"column":4},"end":{"line":37,"column":5}},"10":{"start":{"line":28,"column":23},"end":{"line":28,"column":69}},"11":{"start":{"line":30,"column":6},"end":{"line":34,"column":7}},"12":{"start":{"line":31,"column":8},"end":{"line":31,"column":22}},"13":{"start":{"line":33,"column":8},"end":{"line":33,"column":63}},"14":{"start":{"line":36,"column":6},"end":{"line":36,"column":51}},"15":{"start":{"line":44,"column":6},"end":{"line":44,"column":15}},"16":{"start":{"line":47,"column":4},"end":{"line":47,"column":22}},"17":{"start":{"line":48,"column":42},"end":{"line":48,"column":46}},"18":{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},"19":{"start":{"line":51,"column":6},"end":{"line":54,"column":9}},"20":{"start":{"line":55,"column":6},"end":{"line":55,"column":13}},"21":{"start":{"line":58,"column":16},"end":{"line":58,"column":44}},"22":{"start":{"line":60,"column":4},"end":{"line":89,"column":9}},"23":{"start":{"line":67,"column":21},"end":{"line":67,"column":31}},"24":{"start":{"line":69,"column":8},"end":{"line":85,"column":9}},"25":{"start":{"line":70,"column":10},"end":{"line":73,"column":13}},"26":{"start":{"line":75,"column":10},"end":{"line":75,"column":50}},"27":{"start":{"line":76,"column":10},"end":{"line":84,"column":15}},"28":{"start":{"line":83,"column":14},"end":{"line":83,"column":28}},"29":{"start":{"line":88,"column":8},"end":{"line":88,"column":23}},"30":{"start":{"line":92,"column":2},"end":{"line":204,"column":4}},"31":{"start":{"line":116,"column":18},"end":{"line":116,"column":58}},"32":{"start":{"line":133,"column":18},"end":{"line":133,"column":58}},"33":{"start":{"line":152,"column":18},"end":{"line":152,"column":58}},"34":{"start":{"line":173,"column":18},"end":{"line":173,"column":58}},"35":{"start":{"line":192,"column":18},"end":{"line":192,"column":58}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":19},"end":{"line":11,"column":20}},"loc":{"start":{"line":11,"column":25},"end":{"line":205,"column":1}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":16,"column":12},"end":{"line":16,"column":13}},"loc":{"start":{"line":16,"column":18},"end":{"line":24,"column":3}},"line":16},"2":{"name":"(anonymous_2)","decl":{"start":{"line":26,"column":23},"end":{"line":26,"column":24}},"loc":{"start":{"line":26,"column":35},"end":{"line":38,"column":3}},"line":26},"3":{"name":"handleForm","decl":{"start":{"line":46,"column":11},"end":{"line":46,"column":21}},"loc":{"start":{"line":46,"column":28},"end":{"line":90,"column":3}},"line":46},"4":{"name":"(anonymous_4)","decl":{"start":{"line":67,"column":12},"end":{"line":67,"column":13}},"loc":{"start":{"line":67,"column":21},"end":{"line":67,"column":31}},"line":67},"5":{"name":"(anonymous_5)","decl":{"start":{"line":68,"column":12},"end":{"line":68,"column":13}},"loc":{"start":{"line":68,"column":21},"end":{"line":86,"column":7}},"line":68},"6":{"name":"(anonymous_6)","decl":{"start":{"line":82,"column":18},"end":{"line":82,"column":19}},"loc":{"start":{"line":82,"column":24},"end":{"line":84,"column":13}},"line":82},"7":{"name":"(anonymous_7)","decl":{"start":{"line":87,"column":13},"end":{"line":87,"column":14}},"loc":{"start":{"line":87,"column":20},"end":{"line":89,"column":7}},"line":87},"8":{"name":"(anonymous_8)","decl":{"start":{"line":115,"column":24},"end":{"line":115,"column":25}},"loc":{"start":{"line":116,"column":18},"end":{"line":116,"column":58}},"line":116},"9":{"name":"(anonymous_9)","decl":{"start":{"line":132,"column":24},"end":{"line":132,"column":25}},"loc":{"start":{"line":133,"column":18},"end":{"line":133,"column":58}},"line":133},"10":{"name":"(anonymous_10)","decl":{"start":{"line":151,"column":24},"end":{"line":151,"column":25}},"loc":{"start":{"line":152,"column":18},"end":{"line":152,"column":58}},"line":152},"11":{"name":"(anonymous_11)","decl":{"start":{"line":172,"column":24},"end":{"line":172,"column":25}},"loc":{"start":{"line":173,"column":18},"end":{"line":173,"column":58}},"line":173},"12":{"name":"(anonymous_12)","decl":{"start":{"line":191,"column":24},"end":{"line":191,"column":25}},"loc":{"start":{"line":192,"column":18},"end":{"line":192,"column":58}},"line":192}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":4},"end":{"line":21,"column":5}},"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":21,"column":5}},{"start":{},"end":{}}],"line":19},"1":{"loc":{"start":{"line":19,"column":8},"end":{"line":19,"column":49}},"type":"binary-expr","locations":[{"start":{"line":19,"column":8},"end":{"line":19,"column":21}},{"start":{"line":19,"column":25},"end":{"line":19,"column":49}}],"line":19},"2":{"loc":{"start":{"line":30,"column":6},"end":{"line":34,"column":7}},"type":"if","locations":[{"start":{"line":30,"column":6},"end":{"line":34,"column":7}},{"start":{"line":32,"column":13},"end":{"line":34,"column":7}}],"line":30},"3":{"loc":{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},{"start":{},"end":{}}],"line":50},"4":{"loc":{"start":{"line":69,"column":8},"end":{"line":85,"column":9}},"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":85,"column":9}},{"start":{"line":74,"column":15},"end":{"line":85,"column":9}}],"line":69}},"s":{"0":1,"1":13,"2":13,"3":13,"4":7,"5":7,"6":0,"7":7,"8":13,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":13,"16":4,"17":4,"18":4,"19":1,"20":1,"21":3,"22":3,"23":3,"24":3,"25":1,"26":2,"27":2,"28":0,"29":0,"30":13,"31":2,"32":2,"33":2,"34":2,"35":2},"f":{"0":13,"1":7,"2":0,"3":4,"4":3,"5":3,"6":0,"7":0,"8":2,"9":2,"10":2,"11":2,"12":2},"b":{"0":[0,7],"1":[7,0],"2":[0,0],"3":[1,3],"4":[1,2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"3ccab8afda60ab585f0d07c97ed906d1bd7f514d"} +} diff --git a/frontend/coverage/lcov-report/Components/Modal/Modal.jsx.html b/frontend/coverage/lcov-report/Components/Modal/Modal.jsx.html new file mode 100644 index 00000000..4ee75b94 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/Modal/Modal.jsx.html @@ -0,0 +1,220 @@ + + + + + + Code coverage report for Components/Modal/Modal.jsx + + + + + + + + + +
+
+

All files / Components/Modal Modal.jsx

+
+ +
+ 100% + Statements + 5/5 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 5/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46  +  +1x +6x +2x +2x +  +  +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import React from 'react';
+ 
+const Modal = ({ closeModal }) => {
+    const handleClose = (e) => {
+        e.preventDefault(); // Prevent any default behavior (like form submission)
+        closeModal();// Close the modal
+    };
+ 
+    return (
+        <div className="modal">
+            <div className="modal-content">
+                <span className="close" onClick={handleClose}>&times;</span>
+                <h2>Fairlearn & Performance Metrics</h2>
+                <p>In the context of model evaluation, <strong>accuracy</strong> and the rates of <strong>false
+                    positives</strong> and <strong>false negatives</strong> are essential metrics for understanding the
+                    performance of a model:</p>
+ 
+                <ul>
+                    <li><strong>Accuracy</strong>: This is the proportion of correct predictions (both true positives
+                        and true negatives) to the total predictions. It is defined as:
+                    </li>
+                    <pre><code>Accuracy = (True Positives + True Negatives) / Total Predictions</code></pre>
+ 
+                    <li><strong>False Positive Rate (FPR)</strong>: This is the proportion of negative instances that
+                        are incorrectly classified as positive. A high FPR means the model is incorrectly identifying
+                        too many negative instances as positive.
+                    </li>
+                    <pre><code>False Positive Rate = False Positives / (False Positives + True Negatives)</code></pre>
+ 
+                    <li><strong>False Negative Rate (FNR)</strong>: This is the proportion of positive instances that
+                        are incorrectly classified as negative. A high FNR indicates that the model is missing a
+                        significant number of actual positive instances.
+                    </li>
+                    <pre><code>False Negative Rate = False Negatives / (False Negatives + True Positives)</code></pre>
+                </ul>
+ 
+                <p>These metrics are critical for evaluating a model's fairness, as biases in these rates can
+                    disproportionately affect certain demographic groups. By using Fairlearn, you can ensure your model
+                    is both accurate and fair across various groups.</p>
+            </div>
+        </div>
+    );
+};
+ 
+export default Modal;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Components/Modal/index.html b/frontend/coverage/lcov-report/Components/Modal/index.html new file mode 100644 index 00000000..2b59f094 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/Modal/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for Components/Modal + + + + + + + + + +
+
+

All files Components/Modal

+
+ +
+ 100% + Statements + 5/5 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 5/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Modal.jsx +
+
100%5/5100%0/0100%2/2100%5/5
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Components/Navbar/Navbar.jsx.html b/frontend/coverage/lcov-report/Components/Navbar/Navbar.jsx.html new file mode 100644 index 00000000..9c247cb7 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/Navbar/Navbar.jsx.html @@ -0,0 +1,202 @@ + + + + + + Code coverage report for Components/Navbar/Navbar.jsx + + + + + + + + + +
+
+

All files / Components/Navbar Navbar.jsx

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40  +  +  +  +3x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { Link } from "react-router-dom";
+import "./Navbar.css";
+ 
+function Navbar() {
+  return (
+    <>
+      <nav className="navbar navbar-expand-lg navbar-light bg-light">
+        <div className="container-fluid">
+          <div className="logo-container">
+            <img
+              className="cash-logo"
+              src="/cash-app-logo.png"
+              alt="CashApp's logo in green"
+            />
+          </div>
+          <div
+            className="menu-container collapse navbar-collapse"
+            id="navbarSupportedContent"
+          >
+            <ul className="navbar-nav me-auto mb-2 mb-lg-0">
+              <li className="nav-item">
+                <Link className="nav-link" to="/">
+                  Login
+                </Link>
+              </li>
+              <li className="nav-item">
+                <Link className="nav-link" to="/signup">
+                  Sign Up
+                </Link>
+              </li>
+            </ul>
+          </div>
+        </div>
+      </nav>
+    </>
+  );
+}
+ 
+export default Navbar;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Components/Navbar/index.html b/frontend/coverage/lcov-report/Components/Navbar/index.html new file mode 100644 index 00000000..152a80e3 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/Navbar/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for Components/Navbar + + + + + + + + + +
+
+

All files Components/Navbar

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Navbar.jsx +
+
100%1/1100%0/0100%1/1100%1/1
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Components/UserNavbar/UserNavbar.jsx.html b/frontend/coverage/lcov-report/Components/UserNavbar/UserNavbar.jsx.html new file mode 100644 index 00000000..3e5f2970 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/UserNavbar/UserNavbar.jsx.html @@ -0,0 +1,319 @@ + + + + + + Code coverage report for Components/UserNavbar/UserNavbar.jsx + + + + + + + + + +
+
+

All files / Components/UserNavbar UserNavbar.jsx

+
+ +
+ 90% + Statements + 9/10 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 90% + Lines + 9/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79  +  +  +  +  +  +  +5x +  +5x +  +5x +2x +2x +  +2x +1x +  +1x +  +  +  +  +  +  +5x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { Link } from "react-router-dom";
+import { useNavigate } from "react-router-dom";
+import axios from "axios";
+import "./UserNavbar.css";
+import { envConfig } from "../../envConfig";
+ 
+function UserNavbar() {
+  const VITE_BACKEND_URL = envConfig();
+ 
+  const navigate = useNavigate();
+ 
+  const handleLogout = async () => {
+    try {
+      const response = await axios.post(`${VITE_BACKEND_URL}/logout`);
+ 
+      if (response.data.error === false) {
+        navigate("/");
+      } else {
+        console.error("Logout failed:", response.data.message);
+      }
+    } catch (error) {
+      console.error("Error during logout:", error);
+    }
+  };
+ 
+  return (
+      <>
+        <nav className="navbar navbar-expand-lg navbar-light bg-light">
+          <div className="container-fluid">
+            <div>
+              <img
+                  className="cash-logo"
+                  src="/cash-app-logo.png"
+                  alt="CashApp's logo in green"
+              />
+            </div>
+            <div
+                className="menu-container collapse navbar-collapse"
+                id="navbarSupportedContent"
+            >
+              <ul className="navbar-nav me-auto mb-2 mb-lg-0">
+              <li className="nav-item">
+                  <Link className="nav-link" to="/about">
+                    About Us
+                  </Link>
+                </li>
+                <li className="nav-item">
+                  <Link className="nav-link" to="/dashboard">
+                    Dashboard
+                  </Link>
+                </li>
+                <li className="nav-item">
+                  <Link className="nav-link" to="/model-tester">
+                    Model Tester
+                  </Link>
+                </li>
+                <li className="nav-item">
+                  <Link className="nav-link" to="/change-password">
+                    Change Password
+                  </Link>
+                </li>
+              </ul>
+              <div className="btn-container">
+                <button
+                    className="logout-btn btn btn-outline-danger ms-2"
+                    onClick={handleLogout}
+                >
+                  Logout
+                </button>
+              </div>
+            </div>
+          </div>
+        </nav>
+      </>
+  );
+}
+ 
+export default UserNavbar;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Components/UserNavbar/index.html b/frontend/coverage/lcov-report/Components/UserNavbar/index.html new file mode 100644 index 00000000..b00e3e85 --- /dev/null +++ b/frontend/coverage/lcov-report/Components/UserNavbar/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for Components/UserNavbar + + + + + + + + + +
+
+

All files Components/UserNavbar

+
+ +
+ 90% + Statements + 9/10 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 90% + Lines + 9/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
UserNavbar.jsx +
+
90%9/10100%2/2100%2/290%9/10
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Layout/PublicLayout.jsx.html b/frontend/coverage/lcov-report/Layout/PublicLayout.jsx.html new file mode 100644 index 00000000..1d0690e8 --- /dev/null +++ b/frontend/coverage/lcov-report/Layout/PublicLayout.jsx.html @@ -0,0 +1,127 @@ + + + + + + Code coverage report for Layout/PublicLayout.jsx + + + + + + + + + +
+
+

All files / Layout PublicLayout.jsx

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +1x +2x +  +  +  +  +  +  +  +  + 
import React from "react";
+import Navbar from "../Components/Navbar/Navbar.jsx";
+import { Outlet } from "react-router-dom";
+ 
+const PublicLayout = () => {
+    return (
+        <>
+            <Navbar /> {/* Render the Navbar */}
+            <Outlet data-testid="outlet" /> {/* Add data-testid for testing */}
+        </>
+    );
+};
+ 
+export default PublicLayout;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Layout/UserLayout.jsx.html b/frontend/coverage/lcov-report/Layout/UserLayout.jsx.html new file mode 100644 index 00000000..f53b7281 --- /dev/null +++ b/frontend/coverage/lcov-report/Layout/UserLayout.jsx.html @@ -0,0 +1,127 @@ + + + + + + Code coverage report for Layout/UserLayout.jsx + + + + + + + + + +
+
+

All files / Layout UserLayout.jsx

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +1x +1x +  +  +  +  +  +  +  +  + 
import React from "react";
+import UserNavbar from "../Components/UserNavbar/UserNavbar.jsx"; // Import the UserNavbar
+import { Outlet } from "react-router-dom"; // Import Outlet
+ 
+const UserLayout = () => {
+    return (
+        <>
+            <UserNavbar /> {/* Render the User Navbar */}
+            <Outlet /> {/* Render child routes */}
+        </>
+    );
+};
+ 
+export default UserLayout;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/Layout/index.html b/frontend/coverage/lcov-report/Layout/index.html new file mode 100644 index 00000000..bb18c272 --- /dev/null +++ b/frontend/coverage/lcov-report/Layout/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for Layout + + + + + + + + + +
+
+

All files Layout

+
+ +
+ 100% + Statements + 4/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 4/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
PublicLayout.jsx +
+
100%2/2100%0/0100%1/1100%2/2
UserLayout.jsx +
+
100%2/2100%0/0100%1/1100%2/2
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/base.css b/frontend/coverage/lcov-report/base.css new file mode 100644 index 00000000..f418035b --- /dev/null +++ b/frontend/coverage/lcov-report/base.css @@ -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; +} diff --git a/frontend/coverage/lcov-report/block-navigation.js b/frontend/coverage/lcov-report/block-navigation.js new file mode 100644 index 00000000..cc121302 --- /dev/null +++ b/frontend/coverage/lcov-report/block-navigation.js @@ -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) > ` + + // Selecter 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); diff --git a/frontend/coverage/lcov-report/favicon.png b/frontend/coverage/lcov-report/favicon.png new file mode 100644 index 00000000..c1525b81 Binary files /dev/null and b/frontend/coverage/lcov-report/favicon.png differ diff --git a/frontend/coverage/lcov-report/index.html b/frontend/coverage/lcov-report/index.html new file mode 100644 index 00000000..dc486ca9 --- /dev/null +++ b/frontend/coverage/lcov-report/index.html @@ -0,0 +1,266 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 57.93% + Statements + 146/252 +
+ + +
+ 28.4% + Branches + 25/88 +
+ + +
+ 65.27% + Functions + 47/72 +
+ + +
+ 58.6% + Lines + 143/244 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Components/Modal +
+
100%5/5100%0/0100%2/2100%5/5
Components/Navbar +
+
100%1/1100%0/0100%1/1100%1/1
Components/UserNavbar +
+
90%9/10100%2/2100%2/290%9/10
Layout +
+
100%4/4100%0/0100%2/2100%4/4
pages/AboutPage +
+
100%2/2100%0/0100%1/1100%2/2
pages/ChangePassword +
+
72.22%13/1850%1/250%4/872.22%13/18
pages/DashboardPage/ChartComponenet +
+
48.42%46/9526.66%8/3069.56%16/2348.86%43/88
pages/DashboardPage/data +
+
100%1/1100%0/0100%0/0100%1/1
pages/SharePage +
+
33.33%16/4811.11%4/3620%2/1034.04%16/47
pages/UserLogin +
+
68.75%22/3250%4/870%7/1068.75%22/32
pages/UserSignup +
+
75%27/3660%6/1076.92%10/1375%27/36
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/AboutPage/AboutPage.jsx.html b/frontend/coverage/lcov-report/pages/AboutPage/AboutPage.jsx.html new file mode 100644 index 00000000..02ca36ab --- /dev/null +++ b/frontend/coverage/lcov-report/pages/AboutPage/AboutPage.jsx.html @@ -0,0 +1,271 @@ + + + + + + Code coverage report for pages/AboutPage/AboutPage.jsx + + + + + + + + + +
+
+

All files / pages/AboutPage AboutPage.jsx

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63  +  +  +  +1x +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import React from "react";
+import { Container, Row, Col, Card, ListGroup } from "react-bootstrap";
+import "./AboutPage.css"
+ 
+const AboutPage = () => {
+    return (
+        <Container>
+            <h1 className="text-center my-4">About BIAS BUSTERS</h1>
+ 
+            <Row>
+                <Col>
+                    <h2 class="paragraph-like">
+                        We are proud to announce the launch of a new tool that helps engineers identify and address bias in CashApp's machine-learning models. In an effort to promote fairness and equity, we focused on providing clear, actionable insights into gender, race, and other demographic disparities, ensuring that automated decisions are fair across the board.
+                    </h2>
+ 
+                    <h3>Key Features:</h3>
+ 
+                    <Card className="my-3">
+                        <Card.Body>
+                            <Card.Title>1. Bias and Accuracy Measurement</Card.Title>
+                            <Card.Text>
+                                Using the user’s tree-based ML model along with an open-sourced fairness assessment framework, Fairlearn, we implemented a system to measure bias in the user’s model when trained on their inputted datasets. The datasets are automatically processed and sorted by relevant demographics by our tool.
+                            </Card.Text>
+                        </Card.Body>
+                    </Card>
+ 
+                    <Card className="my-3">
+                        <Card.Body>
+                            <Card.Title>2. Visualization</Card.Title>
+                            <Card.Text>
+                                Graphs will be generated based on the user’s choice of demographics on the platform and plotted against each other, demonstrating the possible inaccuracies in bias measurement. An interactive slider was implemented, coloring certain plots red and green, to give the user an understanding of which combinations of demographics are subject to biased decisions executed by their model.
+                            </Card.Text>
+                        </Card.Body>
+                    </Card>
+ 
+                    <Card className="my-3">
+                        <Card.Body>
+                            <Card.Title>3. Static Data Testing</Card.Title>
+                            <Card.Text>
+                                We have generated a static dataset of 10,000 lines for the user to test their ML model on after training. This feature allows the user to upload several models to be tested on our dataset against Fairlearn to demonstrate specific biases within their models.
+                            </Card.Text>
+                        </Card.Body>
+                    </Card>
+ 
+                    <h4 class="paragraph-like">
+                        Our feedback so far has been great, and our product has demonstrated to the engineers at CashApp that there are vast and quick ways, like our product, to tackle the problem of machine-learning bias in today’s world.
+                    </h4>
+                </Col>
+            </Row>
+ 
+            <footer className="text-center my-4">
+                <p>
+                    <strong>CashApp BIAS BUSTERS</strong>
+                    <br />
+                    Press Release - 7 November, 2024
+                </p>
+            </footer>
+        </Container>
+    );
+};
+ 
+export default AboutPage;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/AboutPage/index.html b/frontend/coverage/lcov-report/pages/AboutPage/index.html new file mode 100644 index 00000000..6c5b3eb8 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/AboutPage/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/AboutPage + + + + + + + + + +
+
+

All files pages/AboutPage

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AboutPage.jsx +
+
100%2/2100%0/0100%1/1100%2/2
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/ChangePassword/ChangePassword.jsx.html b/frontend/coverage/lcov-report/pages/ChangePassword/ChangePassword.jsx.html new file mode 100644 index 00000000..eb5f4a35 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/ChangePassword/ChangePassword.jsx.html @@ -0,0 +1,454 @@ + + + + + + Code coverage report for pages/ChangePassword/ChangePassword.jsx + + + + + + + + + +
+
+

All files / pages/ChangePassword ChangePassword.jsx

+
+ +
+ 72.22% + Statements + 13/18 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 50% + Functions + 4/8 +
+ + +
+ 72.22% + Lines + 13/18 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124  +  +  +  +  +1x +3x +  +  +  +  +  +3x +  +3x +1x +  +1x +  +1x +  +  +  +  +  +  +1x +  +1x +1x +  +  +  +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +3x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { useForm } from "react-hook-form";
+import { ErrorMessage } from "@hookform/error-message";
+import swal from "sweetalert2";
+import { envConfig } from "../../envConfig";
+ 
+const ChangePassword = () => {
+  const VITE_BACKEND_URL = envConfig();
+ 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm();
+ 
+  const handleForm = (data) => {
+    console.log(data);
+ 
+    const url = `${VITE_BACKEND_URL}/change_password`;
+ 
+    fetch(url, {
+      method: "POST",
+      headers: {
+        "Content-Type": "application/json",
+      },
+      body: JSON.stringify(data), // Send only the old password, new password, and confirm password
+    })
+      .then((res) => res.json())
+      .then((res) => {
+        console.log(res.data);
+        Iif (res.error === true) {
+          swal.fire({
+            icon: "error",
+            title: res.message,
+          });
+        } else {
+          document.getElementById("form").reset();
+          swal.fire({
+            icon: "success",
+            title: res.message,
+            timer: 1500,
+          });
+        }
+      })
+      .catch((e) => {
+        console.log(e);
+      });
+  };
+ 
+  return (
+    <>
+      <div className="container">
+        <h1> Change Password </h1>
+      </div>
+ 
+      <hr />
+      <div className="alert alert-primary">
+        <form onSubmit={handleSubmit(handleForm)} id="form">
+          <div className="mb-3">
+            <label htmlFor="old_password">Enter Old Password</label>
+            <input
+                id="old_password"
+                {...register("old_password", {
+                  required: "This field is required",
+                })}
+                type="password"
+                className="form-control"
+            />
+            <ErrorMessage
+                errors={errors}
+                name="old_password"
+                render={({message}) => (
+                    <p className="text-danger">{message}</p>
+                )}
+            />
+          </div>
+ 
+          <div className="mb-3">
+            <label htmlFor="new_password">Enter New Password</label>
+            <input
+                id="new_password"
+                {...register("new_password", {
+                  required: "This field is required",
+                })}
+                type="password"
+                className="form-control"
+            />
+            <ErrorMessage
+                errors={errors}
+                name="new_password"
+                render={({message}) => (
+                    <p className="text-danger">{message}</p>
+                )}
+            />
+          </div>
+ 
+          <div className="mb-3">
+            <label htmlFor="confirm_password">Confirm Password</label>
+            <input
+                id="confirm_password"
+                {...register("confirm_password", {
+                  required: "This field is required",
+                })}
+                type="password"
+                className="form-control"
+            />
+            <ErrorMessage
+                errors={errors}
+                name="confirm_password"
+                render={({message}) => (
+                    <p className="text-danger">{message}</p>
+                )}
+            />
+          </div>
+ 
+          <button className="btn btn-primary">Change Password</button>
+        </form>
+ 
+      </div>
+    </>
+  );
+};
+ 
+export default ChangePassword;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/ChangePassword/index.html b/frontend/coverage/lcov-report/pages/ChangePassword/index.html new file mode 100644 index 00000000..fc9292fa --- /dev/null +++ b/frontend/coverage/lcov-report/pages/ChangePassword/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/ChangePassword + + + + + + + + + +
+
+

All files pages/ChangePassword

+
+ +
+ 72.22% + Statements + 13/18 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 50% + Functions + 4/8 +
+ + +
+ 72.22% + Lines + 13/18 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ChangePassword.jsx +
+
72.22%13/1850%1/250%4/872.22%13/18
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/ChartComponent.jsx.html b/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/ChartComponent.jsx.html new file mode 100644 index 00000000..ff451ab3 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/ChartComponent.jsx.html @@ -0,0 +1,940 @@ + + + + + + Code coverage report for pages/DashboardPage/ChartComponenet/ChartComponent.jsx + + + + + + + + + +
+
+

All files / pages/DashboardPage/ChartComponenet ChartComponent.jsx

+
+ +
+ 48.42% + Statements + 46/95 +
+ + +
+ 26.66% + Branches + 8/30 +
+ + +
+ 69.56% + Functions + 16/23 +
+ + +
+ 48.86% + Lines + 43/88 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286  +  +  +  +2x +8x +8x +8x +8x +8x +  +8x +4x +  +4x +  +4x +8x +  +4x +  +  +  +  +  +4x +8x +8x +  +  +4x +4x +  +  +8x +  +8x +  +  +  +  +  +  +  +4x +  +4x +  +  +8x +8x +  +8x +  +  +8x +  +  +  +  +  +  +4x +  +8x +  +  +  +  +  +  +  +  +4x +  +  +  +  +4x +  +4x +1x +  +  +4x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8x +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6x +  +6x +6x +  +  +  +  +  +8x +  +1x +1x +1x +1x +  +  +  +8x +  +  +  +  +  +  +  +  + 
import React, { useEffect, useRef, useImperativeHandle, forwardRef, useState } from "react";
+import Chart from "chart.js/auto";
+import "./ChartComponent.css";
+ 
+const ChartComponent = forwardRef(({ chartData, sliderValue }, ref) => {
+  const chartRef = useRef(null);
+  const myChartRef = useRef(null);
+  const [hoveredIndex, setHoveredIndex] = useState(null);
+  const [accuracyData, setAccuracyData] = useState([]);  
+  const [lastTabIndex, setLastTabIndex] = useState(20);
+ 
+  useEffect(() => {
+    Iif (!chartData) return;
+ 
+    console.log("Rendering chart with data:", chartData);
+ 
+    const uniqueFeature1Groups = Array.from(
+      new Set(chartData.map((item) => item.feature1))
+    );
+    const colorPalette = [
+      "rgba(189, 178, 255, 0.9)",
+      "rgba(253, 255, 182, 0.9)",
+      "rgba(251, 224, 224, 0.9)",
+      "rgba(229, 193, 133, 0.9)"
+    ];
+    const feature1Colors = uniqueFeature1Groups.reduce((acc, group, index) => {
+      acc[group] = colorPalette[index % colorPalette.length];
+      return acc;
+    }, {});
+ 
+    const sortedChartData = [...chartData].sort((a, b) =>
+      a.feature1.localeCompare(b.feature1)
+    );
+ 
+    const labels = sortedChartData.map((item) => item.feature2); 
+ 
+    const newAccuracyData = sortedChartData.map((item) => ({
+      label: item.feature2, 
+      accuracy: item.accuracy,
+      falsePositive: item.falsepositive,
+      falseNegative: item.falsenegative,
+      color: feature1Colors[item.feature1] || "rgba(200, 200, 200, 0.7)", 
+    }));
+ 
+    setAccuracyData(newAccuracyData);
+ 
+    const datasets = [
+      {
+        label: "Accuracy",
+        data: newAccuracyData.map((d) => ({ x: d.label, y: d.accuracy })),
+        backgroundColor: newAccuracyData.map((d) => d.color), 
+        borderColor: newAccuracyData.map(
+          (d) => (d.accuracy > sliderValue ? "rgba(255, 0, 0, 1)" : d.color) 
+        ),
+        borderWidth: newAccuracyData.map(
+          (d) => (d.accuracy > sliderValue ? 3 : 1) 
+        ),
+        borderCapStyle: "round",
+        borderJoinStyle: "round",
+      },
+    ];
+ 
+    const lineData = {
+      label: "Threshold",
+      data: labels.map((label) => ({ x: label, y: sliderValue })),
+      borderColor: "rgba(255, 0, 0, 1)",
+      backgroundColor: "rgba(0, 0, 0, 0)",
+      fill: false,
+      borderWidth: 3,
+      type: "line",
+      pointRadius: 0,
+    };
+ 
+    const data = {
+      labels: labels,
+      datasets: [...datasets, lineData],
+    };
+ 
+    const ctx = chartRef.current.getContext("2d");
+ 
+    if (myChartRef.current) {
+      myChartRef.current.destroy();
+    }
+ 
+    myChartRef.current = new Chart(ctx, {
+      type: "bar",
+      data: data,
+      options: {
+        scales: {
+          x: {
+            offset: true,
+            ticks: {
+              color: "rgba(255, 255, 255, 1)",
+              autoSkip: false,
+            },
+            grid: {
+              offset: true,
+              display: false,
+              color: "rgba(255, 255, 255, 0.4)",
+            },
+            title: {
+              color: "rgba(255, 255, 255, 1)",
+              display: true,
+              text: 'Demographics',
+              font: {
+                size: 16,
+                weight: 'bold',
+              },
+              padding: {
+                top: 8,
+              },
+            },
+          },
+          y: {
+            min: 0,
+            max: 1,
+            beginAtZero: true,
+            ticks: {
+              color: "rgba(255, 255, 255, 1)",
+              autoSkip: false,
+            },
+            grid: {
+              offset: true,
+              display: true,
+              color: "rgba(255, 255, 255, 0.4)",
+            },
+            title: {
+              display: true,
+              text: 'Bias',
+              color: "rgba(255, 255, 255, 1)",
+              font: {
+                size: 16,
+                weight: 'bold',
+              },
+              padding: {
+                bottom: 8,
+              },
+            },
+          },
+        },
+        responsive: true,
+        plugins: {
+          legend: {
+            display: true,
+            labels: {
+              generateLabels: () => {
+                return uniqueFeature1Groups.map((feature1, i) => ({
+                  text: feature1,
+                  fontColor: "white",
+                  fillStyle: feature1Colors[feature1],
+                  strokeStyle: feature1Colors[feature1],
+                  lineWidth: 1,
+                }));
+              },
+            },
+          },
+          tooltip: {
+            enabled: true,
+            callbacks: {
+              label: (tooltipItem) => {
+                const item = newAccuracyData[tooltipItem.dataIndex];
+                return [
+                  `Bias: ${item.accuracy}`,
+                  `False Positive: ${item.falsePositive}`,
+                  `False Negative: ${item.falseNegative}`,
+                ];
+              },
+            },
+          },
+        },
+        onHover: (event, elements) => {
+          if (elements.length) {
+            setHoveredIndex(elements[0].index);
+          } else {
+            setHoveredIndex(null);
+          }
+        },
+      },
+      plugins: [
+        {
+          id: "highlightColumn",
+          afterDraw: (chart) => {
+            if (hoveredIndex === null) return;
+ 
+            const { ctx, chartArea, scales } = chart;
+            const bar = chart.getDatasetMeta(0).data[hoveredIndex];
+            const left = bar.x - bar.width / 2;
+            const right = bar.x + bar.width / 2;
+ 
+            ctx.save();
+            ctx.fillStyle = "rgba(200, 200, 200, 0.3)";
+            ctx.fillRect(
+              left,
+              chartArea.top,
+              right - left,
+              chartArea.bottom - chartArea.top
+            );
+            ctx.restore();
+          },
+        },
+      ],
+    });
+  }, [chartData, sliderValue]);
+ 
+  useEffect(() => {
+    const handleKeyDown = (event) => {
+      console.log("current acitve:", document.activeElement.tabIndex)
+      if (document.activeElement.tabIndex != 19) {
+        return;
+      }
+ 
+      if (event.key === 'Tab') {
+        event.preventDefault(); // Prevent default tab behavior during chart navigation
+  
+        const nextIndex = hoveredIndex === null
+          ? 0
+          : (hoveredIndex + 1);
+  
+        if (nextIndex < accuracyData.length) {
+          setHoveredIndex(nextIndex); 
+          if (myChartRef.current) {
+            const chart = myChartRef.current;
+            // const activeElement = chart.getDatasetMeta(0).data[nextIndex];
+            chart.setActiveElements([{ datasetIndex: 0, index: nextIndex }]);
+            chart.update(); 
+            
+            chart.tooltip.setActiveElements([{ datasetIndex: 0, index: nextIndex }]);
+            chart.tooltip.update();
+            chart.draw();
+          }
+        } else {
+          // After the last accuracy item, allow normal tab flow
+          event.stopImmediatePropagation();  // Stop custom tabbing, allow native behavior
+ 
+          // Focus on the next focusable element (like buttons or other controls)
+          if (lastTabIndex == 19) {
+            setHoveredIndex(nextIndex);
+            if (myChartRef.current) {
+              const chart = myChartRef.current;
+              chart.setActiveElements([{ datasetIndex: 0, index: nextIndex }]);
+              chart.update();
+ 
+              chart.tooltip.setActiveElements([{ datasetIndex: 0, index: nextIndex }]);
+              chart.tooltip.update();
+              chart.draw();
+            }
+          }
+ 
+          const qs = `[tabindex="${lastTabIndex}"]`
+          const nextFocusableElement = document.querySelector(qs);
+          if (nextFocusableElement) {
+            nextFocusableElement.focus();  // Move focus to the element with tabindex="1"
+            setLastTabIndex(lti => lti + 1);
+          }
+        }
+      }
+    };
+  
+    window.addEventListener('keydown', handleKeyDown);
+  
+    return () => {
+      window.removeEventListener('keydown', handleKeyDown);
+    };
+  }, [hoveredIndex, accuracyData.length, lastTabIndex]);
+  
+ 
+ 
+  useImperativeHandle(ref, () => ({
+    downloadChart() {
+      const link = document.createElement("a");
+      link.href = chartRef.current.toDataURL("image/png");
+      link.download = "chart.png";
+      link.click();
+    },
+  }));
+ 
+  return (
+      <div className="chart-container">
+        {/* Add data-testid for chart canvas */}
+        <canvas ref={chartRef} data-testid="chart-canvas" />
+ 
+      </div>
+  );
+});
+ 
+export default ChartComponent;
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/index.html b/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/index.html new file mode 100644 index 00000000..a0cd4716 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/ChartComponenet/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/DashboardPage/ChartComponenet + + + + + + + + + +
+
+

All files pages/DashboardPage/ChartComponenet

+
+ +
+ 48.42% + Statements + 46/95 +
+ + +
+ 26.66% + Branches + 8/30 +
+ + +
+ 69.56% + Functions + 16/23 +
+ + +
+ 48.86% + Lines + 43/88 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ChartComponent.jsx +
+
48.42%46/9526.66%8/3069.56%16/2348.86%43/88
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/Chatbot.jsx.html b/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/Chatbot.jsx.html new file mode 100644 index 00000000..ecf8292b --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/Chatbot.jsx.html @@ -0,0 +1,721 @@ + + + + + + Code coverage report for pages/DashboardPage/Chatbot/Chatbot.jsx + + + + + + + + + +
+
+

All files / pages/DashboardPage/Chatbot Chatbot.jsx

+
+ +
+ 31.42% + Statements + 11/35 +
+ + +
+ 0% + Branches + 0/4 +
+ + +
+ 33.33% + Functions + 4/12 +
+ + +
+ 34.37% + Lines + 11/32 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +9x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +9x +9x +9x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +2x +1x +  +1x +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import React, { useState } from "react";
+import { Chatbot } from "react-chatbot-kit";
+import { ThemeProvider } from "styled-components";
+import "react-chatbot-kit/build/main.css"; // Ensure this is imported
+import { createChatBotMessage } from "react-chatbot-kit";
+ 
+// Define the config object
+const config = {
+    botName: "SupportBot",
+    initialMessages: [
+        createChatBotMessage("Hi! How can I help you today?"),
+    ],
+    customStyles: {
+        botMessageBox: {
+            backgroundColor: "#4caf50",
+        },
+        chatButton: {
+            backgroundColor: "#4caf50",
+        },
+    },
+    state: {},
+    renderChatHeader: () => (
+        <div
+            style={{
+                width: "100%",
+                backgroundColor: "#4caf50",
+                color: "#fff",
+                padding: "10px",
+                fontSize: "18px",
+                fontWeight: "bold",
+                textAlign: "center",
+            }}
+        >
+            Support Chat
+        </div>
+    ),
+    botAvatar: "https://link-to-your-bot-avatar.png",
+    userAvatar: "https://link-to-your-user-avatar.png",
+};
+ 
+ 
+// MessageParser class to match user input with predefined keywords
+class MessageParser {
+    constructor(actionProvider) {
+        this.actionProvider = actionProvider;
+    }
+ 
+    parse(message) {
+        const lowerMessage = message.toLowerCase();
+        const keywordAnswers = [
+            { keyword: "  ", answer: "Hi! How can I help you today?" },
+            { keyword: "started", answer: "To get started, you can see a red point blinking on the screen near 'Import Model.' It will guide you through a walkthrough. If you have any questions, feel free to ask!" },
+            { keyword: "time", answer: "You can change the timeframe by selecting one of the buttons (1 Day, 1 Week, 1 Month, 1 Year) at the top of the chart." },
+            { keyword: "chart", answer: "Make sure you've selected a demographic and values. If data is still missing, try choosing a different demographic or combination of values." },
+            { keyword: "error", answer: "If you're seeing an error, please check if your data input is correct or try refreshing the page." },
+            { keyword: "report", answer: "If you'd like to report an issue, please describe it, and I’ll assist you further." },
+            { keyword: "data", answer: "If you're missing data, please make sure the correct demographic and values are selected. You may need to update or upload new data." },
+            { keyword: "demographic", answer: "Demographics refer to categories such as age, gender, location, and other similar data points. Please choose the relevant demographic for your chart." },
+            { keyword: "refresh", answer: "You can refresh the page by clicking the refresh button or pressing Ctrl + R on your keyboard." },
+            { keyword: "upload", answer: "To upload data, click the 'Upload' button and select your file. Ensure the file format is supported (CSV, Excel, etc.)." },
+            { keyword: "save", answer: "You can save your chart by clicking the 'Save' button. You may also export the data if needed." },
+            { keyword: "login", answer: "To log in, please enter your credentials on the login page. If you don't have an account, you can sign up for one." },
+            { keyword: "logout", answer: "To log out, simply click the logout button at the top right of the page." },
+            { keyword: "dashboard", answer: "The dashboard allows you to view and analyze your data. You can select different charts and demographics to explore insights." },
+            { keyword: "filter", answer: "To filter the data, use the filter options provided next to the chart. You can filter by date range, demographic, or value type." },
+            { keyword: "download", answer: "To download the data, click the 'Download' button and select your preferred file format (CSV, Excel, etc.)." },
+            { keyword: "support", answer: "For additional support, you can visit our help center or contact customer service via email." },
+            { keyword: "contact", answer: "To contact support, please send us an email at support@example.com." },
+            { keyword: "feature", answer: "We are constantly improving our platform. If you have a feature request, feel free to share it with us!" },
+            { keyword: "settings", answer: "You can update your account settings by clicking on your profile icon and selecting 'Settings'." },
+            { keyword: "performance", answer: "If you're experiencing performance issues, try clearing your browser cache or using a different browser." },
+            { keyword: "issues", answer: "If you're encountering issues, please describe the problem, and I'll help troubleshoot or escalate it to support." },
+            { keyword: "thank", answer: "Come on, Navnoor! You only created me. Rather, I should thank you for making me part of the Bias Busters project!" },
+            { keyword: "nice", answer: "Now, can you please focus on your presentation and show your MVP? We can talk later. All the best!" },
+            { keyword: "share", answer: "You can click on the share button at the bottom right of the page and scan the QR code!" }
+        ];
+ 
+        const matchedKeyword = keywordAnswers.find((qa) => lowerMessage.includes(qa.keyword));
+ 
+        if (matchedKeyword) {
+            this.actionProvider.addMessageToBot(matchedKeyword.answer);
+        } else {
+            this.actionProvider.addMessageToBot("Sorry, I didn't understand that. Can you clarify?");
+        }
+    }
+}
+ 
+// ActionProvider class to handle user input actions
+class ActionProvider {
+    constructor(createChatBotMessage, setStateFunc, createClientMessage) {
+        this.createChatBotMessage = createChatBotMessage;
+        this.setState = setStateFunc;
+        this.createClientMessage = createClientMessage;
+    }
+ 
+    speakMessage(message) {
+        if ('speechSynthesis' in window) {
+            console.log('SpeechSynthesis');
+            const utterance = new SpeechSynthesisUtterance(message);
+            utterance.lang = 'en-US'; // Set the language
+            utterance.rate = 1; // Set the speech rate
+            utterance.pitch = 1; // Set the pitch
+            speechSynthesis.speak(utterance);
+        } else {
+            console.warn('Speech Synthesis is not supported in this browser.');
+        }
+    }
+ 
+    addMessageToBot(message) {
+        const botMessage = this.createChatBotMessage(message);
+        this.setState((prevState) => ({
+            ...prevState,
+            messages: [...prevState.messages, botMessage],
+        }));
+        this.speakMessage(message);
+    }
+ 
+    handleUnknown() {
+        const message = this.createChatBotMessage("Sorry, I didn't understand that. Can you rephrase?");
+        this.setState((prevState) => ({
+            ...prevState,
+            messages: [...prevState.messages, message],
+        }));
+        this.speakMessage(message);
+    }
+}
+ 
+const ChatbotComponent = ({ closeChatbot }) => {
+    // const [isChatbotOpen, setIsChatbotOpen] = useState(true); // Track if the chatbot is open
+ 
+    const handleClose = (e) => {
+        e.preventDefault(); // Prevent any default behavior (like form submission)
+        // setIsChatbotOpen(false); // Close the chatbot
+        closeChatbot();
+    };
+ 
+    const theme = {
+        background: "#f5f8fb",
+        fontFamily: "Arial, sans-serif",
+        headerBgColor: "#4caf50 !important", // Add !important
+        headerFontColor: "#fff",
+        headerFontSize: "18px",
+        botBubbleColor: "#4caf50 !important", // Add !important
+        botFontColor: "#fff",
+        userBubbleColor: "#fff",
+        userFontColor: "#4caf50",
+    };
+ 
+    return (
+        // isChatbotOpen && (
+        <ThemeProvider theme={theme}>
+            <div
+                style={{
+                    position: "fixed",
+                    top: "20px", // Adjusted to be slightly lower from the top
+                    left: "20px", // Adjusted to be slightly from the left
+                    right: "0",
+                    bottom: "0",
+                    backgroundColor: "rgba(0, 0, 0, 0.5)",
+                    backdropFilter: "blur(10px)",
+                    display: "flex",
+                    justifyContent: "center",
+                    alignItems: "center",
+                    zIndex: "9999",
+ 
+                }}
+            >
+                <div
+                    style={{
+                        width: "275px",
+                        height: "500px",
+                        borderRadius: "8px",
+                        backgroundColor: "#fff",
+                        overflow: "hidden",
+                        position: "relative",
+                    }}
+                >
+                    <button
+                        onClick={handleClose}
+                        style={{
+                            position: "absolute",
+                            top: "1px", // Adjusted button position
+                            left: "250px", // Changed to left instead of right
+                            backgroundColor: "transparent",
+                            border: "none",
+                            fontSize: "25px", // Increased button size
+                            color: "#4caf50",
+                            cursor: "pointer",
+                            zIndex: "10000", // Ensure it is on top
+                        }}
+                    >
+                        &times;
+                    </button>
+                    <Chatbot
+                        config={config}
+                        messageParser={MessageParser}
+                        actionProvider={ActionProvider}
+                        floating={false}
+                        botDelay={300}
+                        userDelay={200}
+                        headerTitle="Support Bot"
+                        width="100%"
+                        height="100%"
+                    />
+                </div>
+            </div>
+        </ThemeProvider>
+        // )
+    );
+};
+ 
+export default ChatbotComponent;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/index.html b/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/index.html new file mode 100644 index 00000000..4098ce79 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/Chatbot/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/DashboardPage/Chatbot + + + + + + + + + +
+
+

All files pages/DashboardPage/Chatbot

+
+ +
+ 31.42% + Statements + 11/35 +
+ + +
+ 0% + Branches + 0/4 +
+ + +
+ 33.33% + Functions + 4/12 +
+ + +
+ 34.37% + Lines + 11/32 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Chatbot.jsx +
+
31.42%11/350%0/433.33%4/1234.37%11/32
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/data/graphDataDefault.js.html b/frontend/coverage/lcov-report/pages/DashboardPage/data/graphDataDefault.js.html new file mode 100644 index 00000000..dd2680b1 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/data/graphDataDefault.js.html @@ -0,0 +1,433 @@ + + + + + + Code coverage report for pages/DashboardPage/data/graphDataDefault.js + + + + + + + + + +
+
+

All files / pages/DashboardPage/data graphDataDefault.js

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +1171x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
const graphDataDefault = [
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+    {
+        feature1: "Demographic 1",
+        feature2: "Demographic 2",
+        accuracy: 0,
+        falsepositive: 0,
+        falsenegative: 0,
+        combination_label: "Demographic 1 Demographic 2",
+    },
+];
+ 
+export default graphDataDefault;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/DashboardPage/data/index.html b/frontend/coverage/lcov-report/pages/DashboardPage/data/index.html new file mode 100644 index 00000000..ae2d8932 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/DashboardPage/data/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/DashboardPage/data + + + + + + + + + +
+
+

All files pages/DashboardPage/data

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
graphDataDefault.js +
+
100%1/1100%0/0100%0/0100%1/1
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/SharePage/SharePage.jsx.html b/frontend/coverage/lcov-report/pages/SharePage/SharePage.jsx.html new file mode 100644 index 00000000..4a15a9ed --- /dev/null +++ b/frontend/coverage/lcov-report/pages/SharePage/SharePage.jsx.html @@ -0,0 +1,559 @@ + + + + + + Code coverage report for pages/SharePage/SharePage.jsx + + + + + + + + + +
+
+

All files / pages/SharePage SharePage.jsx

+
+ +
+ 33.33% + Statements + 16/48 +
+ + +
+ 11.11% + Branches + 4/36 +
+ + +
+ 20% + Functions + 2/10 +
+ + +
+ 34.04% + Lines + 16/47 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159  +  +  +  +  +  +  +  +1x +6x +6x +6x +  +6x +6x +6x +6x +6x +  +6x +3x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3x +3x +  +  +  +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +6x +  +  +  +  +  +  +  +  +  +  +  +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import React, { useEffect, useState, useRef } from "react";
+import { useParams } from "react-router-dom";
+import axios from 'axios'; // Make sure to import axios if you're using it
+import './SharePage.css'; // Make sure to import the CSS file for styling
+import ChartComponent from "../DashboardPage/ChartComponenet/ChartComponent.jsx";
+import graphDataDefault from '../DashboardPage/data/graphDataDefault.js'; // Import the default graph data
+import { envConfig } from "../../envConfig";
+ 
+const SharePage = () => {
+    const VITE_BACKEND_URL = envConfig;
+    const { encodedData } = useParams(); // Access the encodedData parameter from the URL
+    const chartRef = useRef(null);
+ 
+    const [data, setData] = useState(null);
+    const [loading, setLoading] = useState(true);
+    const [error, setError] = useState(null);
+    const [averageBias, setAverageBias] = useState(null);
+    const [graphData, setGraphData] = useState(graphDataDefault);
+ 
+    useEffect(() => {
+        Iif (encodedData) {
+            setLoading(true);
+            fetch(`${VITE_BACKEND_URL}/share/${encodedData}`, {
+                method: "GET",
+            })
+                .then((response) => {
+                    if (!response.ok) {
+                        throw new Error("Failed to fetch data");
+                    }
+                    return response.json();
+                })
+                .then((data) => {
+ 
+                    if (!data.other_data || !data.graph_data) {
+                        throw new Error("Invalid data format");
+                    }
+                    if (!data.other_data.currUser || !data.other_data.timeframe || !data.other_data.selectedDemographic || !data.other_data.selectedValues || data.other_data.selectedValues[0] === "") {
+                        throw new Error("Missing required data fields");
+                    }
+                    setData(data.other_data);
+                    setLoading(false);
+ 
+                    if (data.graph_data.length === 0) {
+                        alert("No data found for the selected demographics and values. Choose a different combination.");
+                        return;
+                    }
+ 
+                    setGraphData(data.graph_data);
+                    calculateAverageBias(data.graph_data);
+                })
+                .catch((error) => {
+                    setError(error.message);
+                    setLoading(false);
+                });
+        } else {
+            setError("No encoded data found in URL.");
+            setLoading(false);
+        }
+    }, [encodedData]);
+ 
+    const calculateAverageBias = (data) => {
+        if (!Array.isArray(data) || data.length === 0) {
+            throw new Error("Invalid data: Input must be a non-empty array.");
+        }
+ 
+        // Sum all the accuracy values
+        const totalAccuracy = data.reduce((sum, item) => sum + item.accuracy, 0);
+ 
+        // Calculate the average
+        const averageAccuracy = totalAccuracy / data.length;
+ 
+        setAverageBias(parseFloat(averageAccuracy.toFixed(2)));
+    };
+ 
+    const maxValue = () => {
+        let maxInitialElement = -Infinity;
+ 
+        for (const key in graphData) {
+            const initialElement = graphData[key][0];
+            if (initialElement > maxInitialElement) {
+                maxInitialElement = initialElement;
+            }
+        }
+        return maxInitialElement;
+    };
+ 
+    return (
+        <div className="share-page-container">
+            {loading ? (
+                <p className="loading-text">Loading...</p>
+            ) : error ? (
+                <p className="error-message">{error}</p>
+            ) : (
+                <div className="share-page-content">
+                    <h1 className="page-title">
+                        Data by {data.currUser.split('@')[0]} ({data.timeframe.charAt(0).toUpperCase() + data.timeframe.slice(1)})
+                    </h1>
+ 
+                    <div className="center-wrapper">
+                        <div
+                            className="overall-bias"
+                            style={{
+                                backgroundColor: averageBias > 0.5 ? '#ff6666' : '#66ff66', // Change background color
+                            }}
+                        >
+                            Overall Bias: {averageBias}
+                        </div>
+                    </div>
+ 
+                    <div className="graph-container">
+                        <div className="graph-section">
+                            {graphData && Object.keys(graphData).length > 0 && (
+                                <ChartComponent
+                                    ref={chartRef}
+                                    chartData={graphData}
+                                    sliderValue={0.5}
+                                    bias={maxValue()}
+                                />
+                            )}
+                        </div>
+                    </div>
+ 
+                    <div className="data-container">
+                        <div className="demographics-container">
+                            <div className="demographic-item">
+                                <strong className="demographic-title">Demographic 1:</strong>
+                                <span className="demographic-value">
+                                    {data.selectedDemographic.charAt(0).toUpperCase() + data.selectedDemographic.slice(1)}
+                                </span>
+                                <ul className="demographics-list">
+                                    {data.selectedValues &&
+                                        data.selectedValues.map((value, index) => (
+                                            <li key={index}>{value}</li>
+                                        ))}
+                                </ul>
+                            </div>
+                            <div className="demographic-item">
+                                <strong className="demographic-title">Demographic 2:</strong>
+                                <span className="demographic-value">
+                                    {data.secondSelectedDemographic.charAt(0).toUpperCase() + data.secondSelectedDemographic.slice(1)}
+                                </span>
+                                <ul className="demographics-list">
+                                    {data.selectedSecondValues &&
+                                        data.selectedSecondValues.map((value, index) => (
+                                            <li key={index}>{value}</li>
+                                        ))}
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            )}
+        </div>
+    );
+ 
+};
+ 
+export default SharePage;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/SharePage/index.html b/frontend/coverage/lcov-report/pages/SharePage/index.html new file mode 100644 index 00000000..c238d46d --- /dev/null +++ b/frontend/coverage/lcov-report/pages/SharePage/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/SharePage + + + + + + + + + +
+
+

All files pages/SharePage

+
+ +
+ 33.33% + Statements + 16/48 +
+ + +
+ 11.11% + Branches + 4/36 +
+ + +
+ 20% + Functions + 2/10 +
+ + +
+ 34.04% + Lines + 16/47 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
SharePage.jsx +
+
33.33%16/4811.11%4/3620%2/1034.04%16/47
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/UserLogin/UserLogin.jsx.html b/frontend/coverage/lcov-report/pages/UserLogin/UserLogin.jsx.html new file mode 100644 index 00000000..c4eb3375 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/UserLogin/UserLogin.jsx.html @@ -0,0 +1,484 @@ + + + + + + Code coverage report for pages/UserLogin/UserLogin.jsx + + + + + + + + + +
+
+

All files / pages/UserLogin UserLogin.jsx

+
+ +
+ 68.75% + Statements + 22/32 +
+ + +
+ 50% + Branches + 4/8 +
+ + +
+ 70% + Functions + 7/10 +
+ + +
+ 68.75% + Lines + 22/32 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134  +  +  +  +  +  +  +  +  +1x +7x +7x +  +7x +4x +  +4x +  +  +  +4x +  +  +7x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +7x +  +7x +2x +  +2x +  +2x +  +  +  +  +  +  +2x +  +2x +2x +1x +  +  +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +7x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  + 
import React, { useEffect } from "react";
+import { useForm } from "react-hook-form";
+import { ErrorMessage } from "@hookform/error-message";
+import swal from "sweetalert2";
+import { useNavigate } from "react-router-dom";
+import "./UserLogin.css";
+import axios from "axios";
+import { envConfig } from "../../envConfig";
+ 
+const UserLogin = () => {
+  const navigate = useNavigate();
+  const VITE_BACKEND_URL = envConfig();
+ 
+  useEffect(() => {
+    const uploadedFiles = localStorage.getItem("uploadedFiles");
+ 
+    Iif (uploadedFiles && uploadedFiles.length > 0) {
+      handleLogout();
+    }
+ 
+    localStorage.removeItem("uploadedFiles");
+  }, []);
+ 
+  const handleLogout = async () => {
+    try {
+      const response = await axios.post(`${VITE_BACKEND_URL}/logout`);
+ 
+      if (response.data.error === false) {
+        navigate("/");
+      } else {
+        console.error("Logout failed:", response.data.message);
+      }
+    } catch (error) {
+      console.error("Error during logout:", error);
+    }
+  };
+ 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm();
+ 
+  const handleForm = (data) => {
+    console.log(data);
+ 
+    const url = `${VITE_BACKEND_URL}/login`;
+ 
+    fetch(url, {
+      method: "POST",
+      headers: {
+        "Content-Type": "application/json",
+      },
+      body: JSON.stringify(data),
+    })
+      .then((res) => res.json())
+      .then((res) => {
+        console.log(res.data);
+        if (res.error === true) {
+          swal.fire({
+            icon: "error",
+            title: res.message,
+          });
+        } else {
+          document.getElementById("form").reset();
+          swal
+            .fire({
+              icon: "success",
+              title: res.message,
+              timer: 1500,
+            })
+            .then(() => {
+              console.log("Login successful");
+              navigate("/dashboard");
+            });
+        }
+      })
+      .catch((e) => {
+        console.log(e);
+      });
+  };
+ 
+  return (
+    <>
+      <div className="container">
+        <h1>User Login</h1>
+      </div>
+ 
+      <hr />
+      <div className="alert alert-primary">
+        <form onSubmit={handleSubmit(handleForm)} id={"form"}>
+          <div className="mb-3">
+            <label htmlFor="email">Email</label>
+            <input
+              {...register("email", { required: "This field is required" })}
+              type="email"
+              className={"form-control"}
+              id="email"
+            />
+            <ErrorMessage
+              errors={errors}
+              name="email"
+              render={({ message }) => (
+                <p className={"text-danger"}>{message}</p>
+              )}
+            />
+          </div>
+ 
+          <div className="mb-3">
+            <label htmlFor="password">Password</label>
+            <input
+              {...register("password", { required: "This field is required" })}
+              type="password"
+              className={"form-control"}
+              id="password"
+            />
+            <ErrorMessage
+              errors={errors}
+              name="password"
+              render={({ message }) => (
+                <p className={"text-danger"}>{message}</p>
+              )}
+            />
+          </div>
+ 
+          <button className={"btn btn-primary"} aria-label="Login" >Login</button>
+        </form>
+      </div>
+    </>
+  );
+};
+ 
+export default UserLogin;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/UserLogin/index.html b/frontend/coverage/lcov-report/pages/UserLogin/index.html new file mode 100644 index 00000000..67e1844e --- /dev/null +++ b/frontend/coverage/lcov-report/pages/UserLogin/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/UserLogin + + + + + + + + + +
+
+

All files pages/UserLogin

+
+ +
+ 68.75% + Statements + 22/32 +
+ + +
+ 50% + Branches + 4/8 +
+ + +
+ 70% + Functions + 7/10 +
+ + +
+ 68.75% + Lines + 22/32 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
UserLogin.jsx +
+
68.75%22/3250%4/870%7/1068.75%22/32
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/UserSignup/UserSignup.jsx.html b/frontend/coverage/lcov-report/pages/UserSignup/UserSignup.jsx.html new file mode 100644 index 00000000..62f4873d --- /dev/null +++ b/frontend/coverage/lcov-report/pages/UserSignup/UserSignup.jsx.html @@ -0,0 +1,706 @@ + + + + + + Code coverage report for pages/UserSignup/UserSignup.jsx + + + + + + + + + +
+
+

All files / pages/UserSignup UserSignup.jsx

+
+ +
+ 75% + Statements + 27/36 +
+ + +
+ 60% + Branches + 6/10 +
+ + +
+ 76.92% + Functions + 10/13 +
+ + +
+ 75% + Lines + 27/36 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208  +  +  +  +  +  +  +  +  +  +1x +13x +  +13x +  +13x +7x +  +7x +  +  +  +7x +  +  +13x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13x +  +  +4x +4x +  +4x +1x +  +  +  +1x +  +  +3x +  +3x +  +  +  +  +  +  +3x +  +3x +1x +  +  +  +  +2x +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import React, { useEffect } from "react";
+import { useForm } from "react-hook-form";
+import { ErrorMessage } from "@hookform/error-message";
+import swal from "sweetalert2";
+import { useNavigate } from "react-router-dom";
+import "bootstrap/dist/css/bootstrap.min.css";
+import "./UserSignup.css";
+import axios from "axios";
+import { envConfig } from "../../envConfig";
+ 
+const UserSignup = () => {
+  const VITE_BACKEND_URL = envConfig();
+ 
+  const navigate = useNavigate();
+ 
+  useEffect(() => {
+    const uploadedFiles = localStorage.getItem("uploadedFiles");
+ 
+    Iif (uploadedFiles && uploadedFiles.length > 0) {
+      handleLogout();
+    }
+ 
+    localStorage.removeItem("uploadedFiles");
+  }, []);
+ 
+  const handleLogout = async () => {
+    try {
+      const response = await axios.post(`${VITE_BACKEND_URL}/logout`);
+ 
+      if (response.data.error === false) {
+        navigate("/");
+      } else {
+        console.error("Logout failed:", response.data.message);
+      }
+    } catch (error) {
+      console.error("Error during logout:", error);
+    }
+  };
+ 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm();
+ 
+  function handleForm(data) {
+    console.log(data);
+    const { password, confirmPassword } = data;
+ 
+    if (password !== confirmPassword) {
+      swal.fire({
+        icon: "error",
+        title: "Passwords do not match",
+      });
+      return;
+    }
+ 
+    const url = `${VITE_BACKEND_URL}/signup`;
+ 
+    fetch(url, {
+      method: "POST",
+      headers: {
+        "Content-Type": "application/json",
+      },
+      body: JSON.stringify(data),
+    })
+      .then((res) => res.json())
+      .then((res) => {
+        if (res.error === true) {
+          swal.fire({
+            icon: "error",
+            title: res.message,
+          });
+        } else {
+          document.getElementById("form").reset();
+          swal
+            .fire({
+              icon: "success",
+              title: res.message,
+              timer: 1500,
+            })
+            .then(() => {
+              navigate("/");
+            });
+        }
+      })
+      .catch((e) => {
+        console.log(e);
+      });
+  }
+ 
+  return (
+    <>
+      <div className="container">
+        <h1>User Sign Up</h1>
+      </div>
+ 
+      <hr />
+      <div className="alert alert-primary">
+        <form onSubmit={handleSubmit(handleForm)} id="form">
+          <div className="row">
+            <div className="col-md-6 mb-3">
+              <label htmlFor="firstname">First Name</label>
+              <input
+                {...register("firstname", {
+                  required: "First Name is required",
+                })}
+                type="text"
+                className="form-control"
+                id="firstname"
+              />
+              <ErrorMessage
+                errors={errors}
+                name="firstname"
+                render={({ message }) => (
+                  <p className="text-danger">{message}</p>
+                )}
+              />
+            </div>
+ 
+            <div className="col-md-6 mb-3">
+              <label htmlFor="lastname">Last Name</label>
+              <input
+                {...register("lastname", { required: "Last Name is required" })}
+                type="text"
+                className="form-control"
+                id="lastname"
+              />
+              <ErrorMessage
+                errors={errors}
+                name="lastname"
+                render={({ message }) => (
+                  <p className="text-danger">{message}</p>
+                )}
+              />
+            </div>
+          </div>
+ 
+          <div className="row row-email">
+            <div className="col-md-6 mb-3">
+              <label htmlFor="email">Email</label>
+              <input
+                {...register("email", { required: "This field is required" })}
+                type="email"
+                className="form-control w-100"
+                id="email"
+              />
+              <ErrorMessage
+                errors={errors}
+                name="email"
+                render={({ message }) => (
+                  <p className="text-danger">{message}</p>
+                )}
+              />
+            </div>
+          </div>
+ 
+          <div className="row">
+            <div className="col-md-6 mb-3">
+              <label htmlFor="password">Password</label>
+              <input
+                {...register("password", {
+                  required: "This field is required",
+                })}
+                type="password"
+                className="form-control"
+                id="password"
+              />
+              <ErrorMessage
+                errors={errors}
+                name="password"
+                render={({ message }) => (
+                  <p className="text-danger">{message}</p>
+                )}
+              />
+            </div>
+ 
+            <div className="col-md-6 mb-3">
+              <label htmlFor="confirmPassword">Confirm Password</label>
+              <input
+                {...register("confirmPassword", {
+                  required: "This field is required",
+                })}
+                type="password"
+                className="form-control"
+                id="confirmPassword"
+              />
+              <ErrorMessage
+                errors={errors}
+                name="confirmPassword"
+                render={({ message }) => (
+                  <p className="text-danger">{message}</p>
+                )}
+              />
+            </div>
+          </div>
+ 
+          <button type="submit" className="btn btn-primary" aria-label="Submit">
+            Submit
+          </button>
+        </form>
+      </div>
+    </>
+  );
+};
+ 
+export default UserSignup;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/pages/UserSignup/index.html b/frontend/coverage/lcov-report/pages/UserSignup/index.html new file mode 100644 index 00000000..c9e7da06 --- /dev/null +++ b/frontend/coverage/lcov-report/pages/UserSignup/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for pages/UserSignup + + + + + + + + + +
+
+

All files pages/UserSignup

+
+ +
+ 75% + Statements + 27/36 +
+ + +
+ 60% + Branches + 6/10 +
+ + +
+ 76.92% + Functions + 10/13 +
+ + +
+ 75% + Lines + 27/36 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
UserSignup.jsx +
+
75%27/3660%6/1076.92%10/1375%27/36
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/coverage/lcov-report/prettify.css b/frontend/coverage/lcov-report/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/frontend/coverage/lcov-report/prettify.css @@ -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} diff --git a/frontend/coverage/lcov-report/prettify.js b/frontend/coverage/lcov-report/prettify.js new file mode 100644 index 00000000..b3225238 --- /dev/null +++ b/frontend/coverage/lcov-report/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/frontend/coverage/lcov-report/sort-arrow-sprite.png b/frontend/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 00000000..6ed68316 Binary files /dev/null and b/frontend/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/frontend/coverage/lcov-report/sorter.js b/frontend/coverage/lcov-report/sorter.js new file mode 100644 index 00000000..2bb296a8 --- /dev/null +++ b/frontend/coverage/lcov-report/sorter.js @@ -0,0 +1,196 @@ +/* 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; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = '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 + ''; + } + } + 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); diff --git a/frontend/coverage/lcov.info b/frontend/coverage/lcov.info new file mode 100644 index 00000000..3808fc16 --- /dev/null +++ b/frontend/coverage/lcov.info @@ -0,0 +1,584 @@ +TN: +SF:src/Components/Modal/Modal.jsx +FN:3,(anonymous_0) +FN:4,(anonymous_1) +FNF:2 +FNH:2 +FNDA:6,(anonymous_0) +FNDA:2,(anonymous_1) +DA:3,1 +DA:4,6 +DA:5,2 +DA:6,2 +DA:9,6 +LF:5 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/Components/Navbar/Navbar.jsx +FN:4,Navbar +FNF:1 +FNH:1 +FNDA:3,Navbar +DA:5,3 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/Components/UserNavbar/UserNavbar.jsx +FN:7,UserNavbar +FN:12,(anonymous_1) +FNF:2 +FNH:2 +FNDA:5,UserNavbar +FNDA:2,(anonymous_1) +DA:8,5 +DA:10,5 +DA:12,5 +DA:13,2 +DA:14,2 +DA:16,2 +DA:17,1 +DA:19,1 +DA:22,0 +DA:26,5 +LF:10 +LH:9 +BRDA:16,0,0,1 +BRDA:16,0,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:src/Layout/PublicLayout.jsx +FN:5,(anonymous_0) +FNF:1 +FNH:1 +FNDA:2,(anonymous_0) +DA:5,1 +DA:6,2 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/Layout/UserLayout.jsx +FN:5,(anonymous_0) +FNF:1 +FNH:1 +FNDA:1,(anonymous_0) +DA:5,1 +DA:6,1 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/pages/AboutPage/AboutPage.jsx +FN:5,(anonymous_0) +FNF:1 +FNH:1 +FNDA:6,(anonymous_0) +DA:5,1 +DA:6,6 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/pages/ChangePassword/ChangePassword.jsx +FN:6,(anonymous_0) +FN:15,(anonymous_1) +FN:27,(anonymous_2) +FN:28,(anonymous_3) +FN:44,(anonymous_4) +FN:71,(anonymous_5) +FN:90,(anonymous_6) +FN:109,(anonymous_7) +FNF:8 +FNH:4 +FNDA:3,(anonymous_0) +FNDA:1,(anonymous_1) +FNDA:1,(anonymous_2) +FNDA:1,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +DA:6,1 +DA:7,3 +DA:13,3 +DA:15,3 +DA:16,1 +DA:18,1 +DA:20,1 +DA:27,1 +DA:29,1 +DA:30,1 +DA:31,0 +DA:36,1 +DA:37,1 +DA:45,0 +DA:49,3 +DA:72,0 +DA:91,0 +DA:110,0 +LF:18 +LH:13 +BRDA:30,0,0,0 +BRDA:30,0,1,1 +BRF:2 +BRH:1 +end_of_record +TN: +SF:src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx +FN:5,(anonymous_0) +FN:12,(anonymous_1) +FN:18,(anonymous_2) +FN:26,(anonymous_3) +FN:31,(anonymous_4) +FN:35,(anonymous_5) +FN:37,(anonymous_6) +FN:50,(anonymous_7) +FN:51,(anonymous_8) +FN:53,(anonymous_9) +FN:56,(anonymous_10) +FN:65,(anonymous_11) +FN:146,(anonymous_12) +FN:147,(anonymous_13) +FN:160,(anonymous_14) +FN:171,(anonymous_15) +FN:182,(anonymous_16) +FN:205,(anonymous_17) +FN:206,(anonymous_18) +FN:253,(anonymous_19) +FN:261,(anonymous_20) +FN:268,(anonymous_21) +FN:269,(anonymous_22) +FNF:23 +FNH:16 +FNDA:8,(anonymous_0) +FNDA:4,(anonymous_1) +FNDA:8,(anonymous_2) +FNDA:8,(anonymous_3) +FNDA:4,(anonymous_4) +FNDA:8,(anonymous_5) +FNDA:8,(anonymous_6) +FNDA:8,(anonymous_7) +FNDA:8,(anonymous_8) +FNDA:8,(anonymous_9) +FNDA:8,(anonymous_10) +FNDA:8,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:0,(anonymous_14) +FNDA:0,(anonymous_15) +FNDA:0,(anonymous_16) +FNDA:6,(anonymous_17) +FNDA:0,(anonymous_18) +FNDA:0,(anonymous_19) +FNDA:6,(anonymous_20) +FNDA:2,(anonymous_21) +FNDA:1,(anonymous_22) +DA:5,2 +DA:6,8 +DA:7,8 +DA:8,8 +DA:9,8 +DA:10,8 +DA:12,8 +DA:13,4 +DA:15,4 +DA:17,4 +DA:18,8 +DA:20,4 +DA:26,4 +DA:27,8 +DA:28,8 +DA:31,4 +DA:32,4 +DA:35,8 +DA:37,8 +DA:45,4 +DA:47,4 +DA:50,8 +DA:51,8 +DA:53,8 +DA:56,8 +DA:63,4 +DA:65,8 +DA:74,4 +DA:79,4 +DA:81,4 +DA:82,1 +DA:85,4 +DA:147,0 +DA:161,0 +DA:162,0 +DA:172,0 +DA:173,0 +DA:175,0 +DA:183,0 +DA:185,0 +DA:186,0 +DA:187,0 +DA:188,0 +DA:190,0 +DA:191,0 +DA:192,0 +DA:198,0 +DA:205,8 +DA:206,6 +DA:207,0 +DA:208,0 +DA:209,0 +DA:212,0 +DA:213,0 +DA:215,0 +DA:219,0 +DA:220,0 +DA:221,0 +DA:222,0 +DA:224,0 +DA:225,0 +DA:227,0 +DA:228,0 +DA:229,0 +DA:233,0 +DA:236,0 +DA:237,0 +DA:238,0 +DA:239,0 +DA:240,0 +DA:241,0 +DA:243,0 +DA:244,0 +DA:245,0 +DA:249,0 +DA:250,0 +DA:251,0 +DA:252,0 +DA:253,0 +DA:259,6 +DA:261,6 +DA:262,6 +DA:268,8 +DA:270,1 +DA:271,1 +DA:272,1 +DA:273,1 +DA:277,8 +LF:88 +LH:43 +BRDA:13,0,0,0 +BRDA:13,0,1,4 +BRDA:42,1,0,8 +BRDA:42,1,1,0 +BRDA:53,2,0,3 +BRDA:53,2,1,5 +BRDA:56,3,0,3 +BRDA:56,3,1,5 +BRDA:81,4,0,1 +BRDA:81,4,1,3 +BRDA:172,5,0,0 +BRDA:172,5,1,0 +BRDA:183,6,0,0 +BRDA:183,6,1,0 +BRDA:208,7,0,0 +BRDA:208,7,1,0 +BRDA:212,8,0,0 +BRDA:212,8,1,0 +BRDA:215,9,0,0 +BRDA:215,9,1,0 +BRDA:219,10,0,0 +BRDA:219,10,1,0 +BRDA:221,11,0,0 +BRDA:221,11,1,0 +BRDA:236,12,0,0 +BRDA:236,12,1,0 +BRDA:238,13,0,0 +BRDA:238,13,1,0 +BRDA:251,14,0,0 +BRDA:251,14,1,0 +BRF:30 +BRH:8 +end_of_record +TN: +SF:src/pages/DashboardPage/data/graphDataDefault.js +FNF:0 +FNH:0 +DA:1,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/pages/SharePage/SharePage.jsx +FN:9,(anonymous_0) +FN:20,(anonymous_1) +FN:26,(anonymous_2) +FN:32,(anonymous_3) +FN:51,(anonymous_4) +FN:61,(anonymous_5) +FN:67,(anonymous_6) +FN:75,(anonymous_7) +FN:132,(anonymous_8) +FN:144,(anonymous_9) +FNF:10 +FNH:2 +FNDA:6,(anonymous_0) +FNDA:3,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +DA:9,1 +DA:10,6 +DA:11,6 +DA:12,6 +DA:14,6 +DA:15,6 +DA:16,6 +DA:17,6 +DA:18,6 +DA:20,6 +DA:21,3 +DA:22,0 +DA:23,0 +DA:27,0 +DA:28,0 +DA:30,0 +DA:34,0 +DA:35,0 +DA:37,0 +DA:38,0 +DA:40,0 +DA:41,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:48,0 +DA:49,0 +DA:52,0 +DA:53,0 +DA:56,3 +DA:57,3 +DA:61,6 +DA:62,0 +DA:63,0 +DA:67,0 +DA:70,0 +DA:72,0 +DA:75,6 +DA:76,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:81,0 +DA:84,0 +DA:87,6 +DA:133,0 +DA:145,0 +LF:47 +LH:16 +BRDA:21,0,0,0 +BRDA:21,0,1,3 +BRDA:27,1,0,0 +BRDA:27,1,1,0 +BRDA:34,2,0,0 +BRDA:34,2,1,0 +BRDA:34,3,0,0 +BRDA:34,3,1,0 +BRDA:37,4,0,0 +BRDA:37,4,1,0 +BRDA:37,5,0,0 +BRDA:37,5,1,0 +BRDA:37,5,2,0 +BRDA:37,5,3,0 +BRDA:37,5,4,0 +BRDA:43,6,0,0 +BRDA:43,6,1,0 +BRDA:62,7,0,0 +BRDA:62,7,1,0 +BRDA:62,8,0,0 +BRDA:62,8,1,0 +BRDA:80,9,0,0 +BRDA:80,9,1,0 +BRDA:89,10,0,3 +BRDA:89,10,1,3 +BRDA:91,11,0,3 +BRDA:91,11,1,0 +BRDA:103,12,0,0 +BRDA:103,12,1,0 +BRDA:112,13,0,0 +BRDA:112,13,1,0 +BRDA:112,13,2,0 +BRDA:131,14,0,0 +BRDA:131,14,1,0 +BRDA:143,15,0,0 +BRDA:143,15,1,0 +BRF:36 +BRH:4 +end_of_record +TN: +SF:src/pages/UserLogin/UserLogin.jsx +FN:10,(anonymous_0) +FN:14,(anonymous_1) +FN:24,(anonymous_2) +FN:44,(anonymous_3) +FN:56,(anonymous_4) +FN:57,(anonymous_5) +FN:72,(anonymous_6) +FN:78,(anonymous_7) +FN:103,(anonymous_8) +FN:120,(anonymous_9) +FNF:10 +FNH:7 +FNDA:7,(anonymous_0) +FNDA:4,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:2,(anonymous_3) +FNDA:2,(anonymous_4) +FNDA:2,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:1,(anonymous_8) +FNDA:1,(anonymous_9) +DA:10,1 +DA:11,7 +DA:12,7 +DA:14,7 +DA:15,4 +DA:17,4 +DA:18,0 +DA:21,4 +DA:24,7 +DA:25,0 +DA:26,0 +DA:28,0 +DA:29,0 +DA:31,0 +DA:34,0 +DA:42,7 +DA:44,7 +DA:45,2 +DA:47,2 +DA:49,2 +DA:56,2 +DA:58,2 +DA:59,2 +DA:60,1 +DA:65,1 +DA:66,1 +DA:73,0 +DA:74,0 +DA:79,0 +DA:83,7 +DA:104,1 +DA:121,1 +LF:32 +LH:22 +BRDA:17,0,0,0 +BRDA:17,0,1,4 +BRDA:17,1,0,4 +BRDA:17,1,1,0 +BRDA:28,2,0,0 +BRDA:28,2,1,0 +BRDA:59,3,0,1 +BRDA:59,3,1,1 +BRF:8 +BRH:4 +end_of_record +TN: +SF:src/pages/UserSignup/UserSignup.jsx +FN:11,(anonymous_0) +FN:16,(anonymous_1) +FN:26,(anonymous_2) +FN:46,handleForm +FN:67,(anonymous_4) +FN:68,(anonymous_5) +FN:82,(anonymous_6) +FN:87,(anonymous_7) +FN:115,(anonymous_8) +FN:132,(anonymous_9) +FN:151,(anonymous_10) +FN:172,(anonymous_11) +FN:191,(anonymous_12) +FNF:13 +FNH:10 +FNDA:13,(anonymous_0) +FNDA:7,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:4,handleForm +FNDA:3,(anonymous_4) +FNDA:3,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:2,(anonymous_8) +FNDA:2,(anonymous_9) +FNDA:2,(anonymous_10) +FNDA:2,(anonymous_11) +FNDA:2,(anonymous_12) +DA:11,1 +DA:12,13 +DA:14,13 +DA:16,13 +DA:17,7 +DA:19,7 +DA:20,0 +DA:23,7 +DA:26,13 +DA:27,0 +DA:28,0 +DA:30,0 +DA:31,0 +DA:33,0 +DA:36,0 +DA:44,13 +DA:47,4 +DA:48,4 +DA:50,4 +DA:51,1 +DA:55,1 +DA:58,3 +DA:60,3 +DA:67,3 +DA:69,3 +DA:70,1 +DA:75,2 +DA:76,2 +DA:83,0 +DA:88,0 +DA:92,13 +DA:116,2 +DA:133,2 +DA:152,2 +DA:173,2 +DA:192,2 +LF:36 +LH:27 +BRDA:19,0,0,0 +BRDA:19,0,1,7 +BRDA:19,1,0,7 +BRDA:19,1,1,0 +BRDA:30,2,0,0 +BRDA:30,2,1,0 +BRDA:50,3,0,1 +BRDA:50,3,1,3 +BRDA:69,4,0,1 +BRDA:69,4,1,2 +BRF:10 +BRH:6 +end_of_record diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 98be4161..d270aedc 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -3384,7 +3384,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz", "integrity": "sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==", "dev": true, - "license": "MIT", "dependencies": { "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", @@ -3426,7 +3425,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.0.1.tgz", "integrity": "sha512-dSmwJVtJXmku+iocRhWOUFbrERC76TX2Mnf0ATODz8brzAZrMBbzLwQixlBSanZxR6LddK3eiwpSFZgDET1URg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5" }, @@ -3454,7 +3452,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12", "npm": ">=6" @@ -6581,7 +6578,6 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", diff --git a/frontend/src/Components/Footer/Footer.css b/frontend/src/Components/Footer/Footer.css deleted file mode 100644 index 4776bdc5..00000000 --- a/frontend/src/Components/Footer/Footer.css +++ /dev/null @@ -1,13 +0,0 @@ -.custom-footer-container { - padding: 2rem; /* Adjust padding as needed */ - background-color: #343a40; /* Dark background for the container */ - color: white; /* White text color for content */ - border-radius: 8px; /* Optional: rounded corners for a softer look */ -} - -/* Media query for responsive design */ -@media (max-width: 768px) { - .custom-footer-container { - padding: 1rem; /* Reduce padding on smaller screens */ - } -} \ No newline at end of file diff --git a/frontend/src/Components/Footer/Footer.jsx b/frontend/src/Components/Footer/Footer.jsx deleted file mode 100644 index 58c6fb87..00000000 --- a/frontend/src/Components/Footer/Footer.jsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import { MDBFooter, MDBContainer, MDBBtn } from 'mdb-react-ui-kit'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faGithub } from '@fortawesome/free-brands-svg-icons'; // Only GitHub icon -import { Link } from 'react-router-dom'; // To create the About Us link -import './Footer.css' - -function Footer() { - return ( - - - {/* Social Media Links and About Us Section */} -
- {/* About Us Link */} - - About Us - - - {/* GitHub Icon */} - - - -
- - {/* Description Section */} -
-

- Bias Busters aims to create awareness and reduce biases in decision-making through innovative solutions. Join us in making a difference. -

-
- - {/* Quote Section */} -
-
- "The greatest weapon against stress is our ability to choose one thought over another." -
-

- William James

-
-
- - {/* Footer Bottom */} -
- © 2024 Copyright: Bias Busters -
-
- ); -} - -export default Footer; diff --git a/frontend/src/Components/UserNavbar/UserNavbar.jsx b/frontend/src/Components/UserNavbar/UserNavbar.jsx index 9cf52cdc..374ba927 100644 --- a/frontend/src/Components/UserNavbar/UserNavbar.jsx +++ b/frontend/src/Components/UserNavbar/UserNavbar.jsx @@ -2,9 +2,10 @@ import { Link } from "react-router-dom"; import { useNavigate } from "react-router-dom"; import axios from "axios"; import "./UserNavbar.css"; +import { envConfig } from "../../envConfig"; function UserNavbar() { - const VITE_BACKEND_URL = import.meta.env.VITE_BACKEND_URL; + const VITE_BACKEND_URL = envConfig(); const navigate = useNavigate(); diff --git a/frontend/src/Layout/PublicLayout.jsx b/frontend/src/Layout/PublicLayout.jsx index 3f5fbc44..afc51962 100644 --- a/frontend/src/Layout/PublicLayout.jsx +++ b/frontend/src/Layout/PublicLayout.jsx @@ -1,13 +1,12 @@ import React from "react"; import Navbar from "../Components/Navbar/Navbar.jsx"; -import Footer from "../Components/Footer/Footer.jsx"; // Import Footer import { Outlet } from "react-router-dom"; const PublicLayout = () => { return ( <> {/* Render the Navbar */} - {/* Render child routes here */} + {/* Add data-testid for testing */} ); }; diff --git a/frontend/src/pages/ChangePassword/ChangePassword.jsx b/frontend/src/pages/ChangePassword/ChangePassword.jsx index c9bd46cb..8d37c9bf 100644 --- a/frontend/src/pages/ChangePassword/ChangePassword.jsx +++ b/frontend/src/pages/ChangePassword/ChangePassword.jsx @@ -54,63 +54,67 @@ const ChangePassword = () => {
-
+
- + ( -

{message}

- )} + errors={errors} + name="old_password" + render={({message}) => ( +

{message}

+ )} />
- + ( -

{message}

- )} + errors={errors} + name="new_password" + render={({message}) => ( +

{message}

+ )} />
- + ( -

{message}

- )} + errors={errors} + name="confirm_password" + render={({message}) => ( +

{message}

+ )} />
- +
+
); diff --git a/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx b/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx index c9cdef54..bacc9dbe 100644 --- a/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx +++ b/frontend/src/pages/DashboardPage/ChartComponenet/ChartComponent.jsx @@ -231,15 +231,15 @@ const ChartComponent = forwardRef(({ chartData, sliderValue }, ref) => { } else { // After the last accuracy item, allow normal tab flow event.stopImmediatePropagation(); // Stop custom tabbing, allow native behavior - + // Focus on the next focusable element (like buttons or other controls) if (lastTabIndex == 19) { - setHoveredIndex(nextIndex); + setHoveredIndex(nextIndex); if (myChartRef.current) { const chart = myChartRef.current; chart.setActiveElements([{ datasetIndex: 0, index: nextIndex }]); - chart.update(); - + chart.update(); + chart.tooltip.setActiveElements([{ datasetIndex: 0, index: nextIndex }]); chart.tooltip.update(); chart.draw(); @@ -275,9 +275,11 @@ const ChartComponent = forwardRef(({ chartData, sliderValue }, ref) => { })); return ( -
- -
+
+ {/* Add data-testid for chart canvas */} + + +
); }); diff --git a/frontend/src/pages/DashboardPage/ControlButtons/ControlButtons.jsx b/frontend/src/pages/DashboardPage/ControlButtons/ControlButtons.jsx index 0de28f19..631a27df 100644 --- a/frontend/src/pages/DashboardPage/ControlButtons/ControlButtons.jsx +++ b/frontend/src/pages/DashboardPage/ControlButtons/ControlButtons.jsx @@ -1,9 +1,10 @@ import React, { useRef, useState, useEffect } from "react"; import "bootstrap/dist/css/bootstrap.min.css"; // Import Bootstrap CSS import "./ControlButtons.css"; +import { envConfig } from "../../../envConfig.js"; const ControlButtons = ({ onDownload }) => { - const VITE_BACKEND_URL = import.meta.env.VITE_BACKEND_URL; + const VITE_BACKEND_URL = envConfig(); const [currUser, setCurrUser] = useState(""); const [showModal, setShowModal] = useState(false); // Modal visibility state @@ -197,109 +198,119 @@ const ControlButtons = ({ onDownload }) => { }, [showModal, showModaldataset]); return ( -
- - - - - - - {/* Modal for model upload instructions */} - {showModal && ( -
-
-
-
-
Model Upload Instructions
- -
-
-

File format: The file must be in .pkl format.

-
-
- +
+ + + + + + + {/* Modal for model upload instructions */} + {showModal && ( +
+
+
+
+
Model Upload Instructions
+ +
+
+

File format: The file must be in .pkl format.

+
+
+ +
+
-
-
- )} - - {/* Modal for dataset upload instructions */} - {showModaldataset && ( -
-
-
-
-
Dataset Upload Instructions
- -
-
-

File format: The file must be in .csv format.

-
-
- + )} + + {/* Modal for dataset upload instructions */} + {showModaldataset && ( +
+
+
+
+
Dataset Upload Instructions
+ +
+
+

File format: The file must be in .csv format.

+
+
+ +
+
-
-
- )} -
+ )} +
); + }; export default ControlButtons; diff --git a/frontend/src/pages/SharePage/SharePage.jsx b/frontend/src/pages/SharePage/SharePage.jsx index 50896ccc..f56cbf4c 100644 --- a/frontend/src/pages/SharePage/SharePage.jsx +++ b/frontend/src/pages/SharePage/SharePage.jsx @@ -4,9 +4,10 @@ import axios from 'axios'; // Make sure to import axios if you're using it import './SharePage.css'; // Make sure to import the CSS file for styling import ChartComponent from "../DashboardPage/ChartComponenet/ChartComponent.jsx"; import graphDataDefault from '../DashboardPage/data/graphDataDefault.js'; // Import the default graph data +import { envConfig } from "../../envConfig"; const SharePage = () => { - const VITE_BACKEND_URL = import.meta.env.VITE_BACKEND_URL; + const VITE_BACKEND_URL = envConfig; const { encodedData } = useParams(); // Access the encodedData parameter from the URL const chartRef = useRef(null); diff --git a/frontend/src/pages/UserLogin/UserLogin.jsx b/frontend/src/pages/UserLogin/UserLogin.jsx index d7cd0075..725324fc 100644 --- a/frontend/src/pages/UserLogin/UserLogin.jsx +++ b/frontend/src/pages/UserLogin/UserLogin.jsx @@ -5,10 +5,11 @@ import swal from "sweetalert2"; import { useNavigate } from "react-router-dom"; import "./UserLogin.css"; import axios from "axios"; +import { envConfig } from "../../envConfig"; const UserLogin = () => { const navigate = useNavigate(); - const VITE_BACKEND_URL = import.meta.env.VITE_BACKEND_URL; + const VITE_BACKEND_URL = envConfig(); useEffect(() => { const uploadedFiles = localStorage.getItem("uploadedFiles"); @@ -94,6 +95,7 @@ const UserLogin = () => { {...register("email", { required: "This field is required" })} type="email" className={"form-control"} + id="email" /> { {...register("password", { required: "This field is required" })} type="password" className={"form-control"} + id="password" /> { />
- +
diff --git a/frontend/src/pages/UserSignup/UserSignup.jsx b/frontend/src/pages/UserSignup/UserSignup.jsx index c5e37a3e..1b1a4b53 100644 --- a/frontend/src/pages/UserSignup/UserSignup.jsx +++ b/frontend/src/pages/UserSignup/UserSignup.jsx @@ -6,9 +6,10 @@ import { useNavigate } from "react-router-dom"; import "bootstrap/dist/css/bootstrap.min.css"; import "./UserSignup.css"; import axios from "axios"; +import { envConfig } from "../../envConfig"; const UserSignup = () => { - const VITE_BACKEND_URL = import.meta.env.VITE_BACKEND_URL; + const VITE_BACKEND_URL = envConfig(); const navigate = useNavigate(); @@ -194,7 +195,7 @@ const UserSignup = () => {
- diff --git a/frontend/tests/AboutPage.test.jsx b/frontend/tests/AboutPage.test.jsx new file mode 100644 index 00000000..92bf905c --- /dev/null +++ b/frontend/tests/AboutPage.test.jsx @@ -0,0 +1,64 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import AboutPage from "../src/pages/AboutPage/AboutPage"; + +describe("AboutPage Component", () => { + test("renders main heading", () => { + render(); + expect(screen.getByRole("heading", { name: /about bias busters/i })).toBeInTheDocument(); + }); + + test("renders key features section", () => { + render(); + + + expect(screen.getByRole("heading", { name: /key features:/i })).toBeInTheDocument(); + + + expect(screen.getByText(/bias and accuracy measurement/i)).toBeInTheDocument(); + expect(screen.getByText(/visualization/i)).toBeInTheDocument(); + expect(screen.getByText(/static data testing/i)).toBeInTheDocument(); + }); + + test("renders footer with press release details", () => { + render(); + expect(screen.getByText(/cashapp bias busters/i)).toBeInTheDocument(); + expect(screen.getByText(/press release - 7 november, 2024/i)).toBeInTheDocument(); + }); + + test("renders descriptive paragraphs", () => { + render(); + expect( + screen.getByText( + /we are proud to announce the launch of a new tool that helps engineers identify and address bias/i + ) + ).toBeInTheDocument(); + expect( + screen.getByText( + /our feedback so far has been great, and our product has demonstrated to the engineers/i + ) + ).toBeInTheDocument(); + }); + + test("renders all cards with descriptions", () => { + render(); + + // Verify that all cards are rendered with their descriptions + expect( + screen.getByText( + /using the user’s tree-based ml model along with an open-sourced fairness assessment framework/i + ) + ).toBeInTheDocument(); + expect( + screen.getByText( + /graphs will be generated based on the user’s choice of demographics on the platform/i + ) + ).toBeInTheDocument(); + expect( + screen.getByText( + /we have generated a static dataset of 10,000 lines for the user to test their ml model/i + ) + ).toBeInTheDocument(); + }); +}); diff --git a/frontend/tests/ChangePassword.test.jsx b/frontend/tests/ChangePassword.test.jsx index 5bc5e66d..498adad3 100644 --- a/frontend/tests/ChangePassword.test.jsx +++ b/frontend/tests/ChangePassword.test.jsx @@ -1,40 +1,65 @@ -// ChangePassword.test.jsx import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; import "@testing-library/jest-dom"; +import { act } from "react-dom/test-utils"; import ChangePassword from "../src/pages/ChangePassword/ChangePassword"; -import { envConfig } from "../src/envConfig"; + +global.fetch = jest.fn(() => + Promise.resolve({ + json: () => Promise.resolve({ success: true }), // Mock response from the server + }) +); jest.mock("../src/envConfig", () => ({ - envConfig: () => { - return "test"; - }, + envConfig: () => "test", })); +beforeEach(() => { + fetch.mockClear(); // Clear previous mock calls before each test +}); + test("renders ChangePassword form", () => { - render(); - - // Verify the presence of form elements - expect(screen.getByLabelText("Enter Old Password")).toBeInTheDocument(); - expect(screen.getByLabelText("Enter New Password")).toBeInTheDocument(); - expect(screen.getByLabelText("Confirm Password")).toBeInTheDocument(); - expect( - screen.getByRole("button", { name: /Change Password/i }) - ).toBeInTheDocument(); + render(); + + // Verify the presence of form elements + expect(screen.getByLabelText("Enter Old Password")).toBeInTheDocument(); + expect(screen.getByLabelText("Enter New Password")).toBeInTheDocument(); + expect(screen.getByLabelText("Confirm Password")).toBeInTheDocument(); + expect( + screen.getByRole("button", { name: /Change Password/i }) + ).toBeInTheDocument(); }); test("submits form with valid data", async () => { - render(); - - fireEvent.change(screen.getByLabelText("Enter Old Password"), { - target: { value: "oldpassword123" }, - }); - fireEvent.change(screen.getByLabelText("Enter New Password"), { - target: { value: "newpassword123" }, - }); - fireEvent.change(screen.getByLabelText("Confirm Password"), { - target: { value: "newpassword123" }, - }); - - fireEvent.click(screen.getByRole("button", { name: /Change Password/i })); + render(); + + // Act on form data + await act(async () => { + fireEvent.change(screen.getByLabelText("Enter Old Password"), { + target: { value: "oldpassword123" }, + }); + fireEvent.change(screen.getByLabelText("Enter New Password"), { + target: { value: "newpassword123" }, + }); + fireEvent.change(screen.getByLabelText("Confirm Password"), { + target: { value: "newpassword123" }, + }); + + fireEvent.click(screen.getByRole("button", { name: /Change Password/i })); + }); + + // Check if fetch was called with correct parameters + expect(fetch).toHaveBeenCalledWith( + expect.stringContaining("test/change_password"), // Ensure URL contains 'test/change_password' + expect.objectContaining({ + method: "POST", + body: JSON.stringify({ + old_password: "oldpassword123", + new_password: "newpassword123", + confirm_password: "newpassword123", + }), + headers: { "Content-Type": "application/json" }, + }) + ); }); + diff --git a/frontend/tests/Components/Modals.test.jsx b/frontend/tests/Components/Modals.test.jsx new file mode 100644 index 00000000..377c3b28 --- /dev/null +++ b/frontend/tests/Components/Modals.test.jsx @@ -0,0 +1,85 @@ +import React from 'react'; +import { render, screen, fireEvent } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import Modal from '../../src/Components/Modal/Modal.jsx'; + +describe("Modal Component", () => { + test("renders modal heading", () => { + render(); + expect(screen.getByRole("heading", { name: /Fairlearn & Performance Metrics/i })).toBeInTheDocument(); + }); + + test("renders key metrics descriptions", () => { + render(); + + const accuracyElements = screen.getAllByText(/accuracy/i); + const accuracyStrong = accuracyElements.find(element => element.tagName === 'STRONG'); + expect(accuracyStrong).toBeInTheDocument(); + + const falsePositiveRateElements = screen.getAllByText(/False Positive Rate/i); + const falsePositiveRateStrong = falsePositiveRateElements.find(element => element.tagName === 'STRONG'); + expect(falsePositiveRateStrong).toBeInTheDocument(); + + const falseNegativeRateElements = screen.getAllByText(/False Negative Rate/i); + const falseNegativeRateStrong = falseNegativeRateElements.find(element => element.tagName === 'STRONG'); + expect(falseNegativeRateStrong).toBeInTheDocument(); + + expect(screen.getByText(/Accuracy = \(True Positives \+ True Negatives\) \/ Total Predictions/i)).toBeInTheDocument(); + expect(screen.getByText(/False Positive Rate = False Positives \/ \(False Positives \+ True Negatives\)/i)).toBeInTheDocument(); + expect(screen.getByText(/False Negative Rate = False Negatives \/ \(False Negatives \+ True Positives\)/i)).toBeInTheDocument(); + }); + + + + + + test("renders modal with list of formulas", () => { + render(); + + // Check if the formulas are rendered + expect( + screen.getByText(/Accuracy = \(True Positives \+ True Negatives\) \/ Total Predictions/i) + ).toBeInTheDocument(); + expect( + screen.getByText( + /False Positive Rate = False Positives \/ \(False Positives \+ True Negatives\)/i + ) + ).toBeInTheDocument(); + expect( + screen.getByText( + /False Negative Rate = False Negatives \/ \(False Negatives \+ True Positives\)/i + ) + ).toBeInTheDocument(); + }); + + test("renders close button", () => { + render(); + const closeButton = screen.getByText('×'); + expect(closeButton).toBeInTheDocument(); + }); + + test("closes modal when close button is clicked", () => { + const mockCloseModal = jest.fn(); + render(); + + const closeButton = screen.getByText('×'); + fireEvent.click(closeButton); + + // Verify that the closeModal function was called + expect(mockCloseModal).toHaveBeenCalledTimes(1); + }); + + test("prevents default behavior on close button click", () => { + const mockCloseModal = jest.fn(); // Mock the closeModal function + render(); + + const closeButton = screen.getByText('×'); + + const event = { preventDefault: jest.fn() }; + + fireEvent.click(closeButton, event); + + expect(event.preventDefault).toHaveBeenCalledTimes(0); + }); + +}); \ No newline at end of file diff --git a/frontend/tests/Components/Navbar.test.jsx b/frontend/tests/Components/Navbar.test.jsx new file mode 100644 index 00000000..2761c816 --- /dev/null +++ b/frontend/tests/Components/Navbar.test.jsx @@ -0,0 +1,22 @@ +import { render, screen } from "@testing-library/react"; +import { MemoryRouter } from "react-router-dom"; +import Navbar from "../../src/Components/Navbar/Navbar"; + +test("renders Navbar with logo and links", () => { + render( + + + + ); + + const logo = screen.getByAltText("CashApp's logo in green"); + expect(logo).toBeInTheDocument(); + + const loginLink = screen.getByText(/login/i); + expect(loginLink).toBeInTheDocument(); + expect(loginLink.closest('a')).toHaveAttribute('href', '/'); + + const signUpLink = screen.getByText(/sign up/i); + expect(signUpLink).toBeInTheDocument(); + expect(signUpLink.closest('a')).toHaveAttribute('href', '/signup'); +}); diff --git a/frontend/tests/Components/UserNavbar.test.jsx b/frontend/tests/Components/UserNavbar.test.jsx new file mode 100644 index 00000000..861c9da3 --- /dev/null +++ b/frontend/tests/Components/UserNavbar.test.jsx @@ -0,0 +1,75 @@ +import React from "react"; +import { render, screen, fireEvent, waitFor } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { act } from "react-dom/test-utils"; +import UserNavbar from "../../src/components/UserNavbar/UserNavbar"; +import { BrowserRouter as Router } from "react-router-dom"; +import axios from "axios"; + +jest.mock("axios"); + +jest.mock("../../src/envConfig", () => ({ + envConfig: () => "test", +})); + +beforeEach(() => { + axios.post.mockClear(); +}); + +test("renders UserNavbar with links", () => { + render( + + + + ); + + // Verify the presence of navigation links + expect(screen.getByText("About Us")).toBeInTheDocument(); + expect(screen.getByText("Dashboard")).toBeInTheDocument(); + expect(screen.getByText("Model Tester")).toBeInTheDocument(); + expect(screen.getByText("Change Password")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /Logout/i })).toBeInTheDocument(); +}); + +test("logs out successfully when logout button is clicked", async () => { + + axios.post.mockResolvedValueOnce({ + data: { error: false, message: "Logged out successfully" }, + }); + + render( + + + + ); + + const logoutButton = screen.getByRole("button", { name: /Logout/i }); + fireEvent.click(logoutButton); + + await waitFor(() => { + expect(axios.post).toHaveBeenCalledWith("test/logout"); + }); +}); + + +test("handles logout failure correctly", async () => { + + axios.post.mockResolvedValueOnce({ + data: { error: true, message: "Logout failed" }, + }); + + render( + + + + ); + + const logoutButton = screen.getByRole("button", { name: /Logout/i }); + fireEvent.click(logoutButton); + + const consoleErrorSpy = jest.spyOn(console, "error").mockImplementation(); + await waitFor(() => { + expect(consoleErrorSpy).toHaveBeenCalledWith("Logout failed:", "Logout failed"); + }); + consoleErrorSpy.mockRestore(); +}); diff --git a/frontend/tests/Dashboard/ChartComponent.test.jsx b/frontend/tests/Dashboard/ChartComponent.test.jsx new file mode 100644 index 00000000..1d29d174 --- /dev/null +++ b/frontend/tests/Dashboard/ChartComponent.test.jsx @@ -0,0 +1,79 @@ +import React from "react"; +import { render, screen, fireEvent, act, waitFor} from "@testing-library/react"; +import "@testing-library/jest-dom"; +import userEvent from '@testing-library/user-event'; + +import ChartComponent from "../../src/pages/DashboardPage/ChartComponenet/ChartComponent"; // Adjust path as needed + +// Mock the chart.js/auto module to mock the default export correctly +jest.mock('chart.js/auto', () => { + return { + __esModule: true, // This tells Jest that we're mocking a module with a default export + default: jest.fn().mockImplementation(() => ({ + update: jest.fn(), + destroy: jest.fn(), + })), + }; +}); + +beforeEach(() => { + jest.clearAllMocks(); // Clear mocks before each test to avoid state pollution +}); + +test("renders ChartComponent with chart data", () => { + const chartData = [ + { feature1: "Group1", feature2: "Label1", accuracy: 0.8, falsepositive: 0.1, falsenegative: 0.1 }, + { feature1: "Group2", feature2: "Label2", accuracy: 0.7, falsepositive: 0.2, falsenegative: 0.1 }, + ]; + const sliderValue = 0.75; + + render(); + + // Check if the chart canvas is rendered + const chartCanvas = screen.getByTestId("chart-canvas"); + expect(chartCanvas).toBeInTheDocument(); +}); + +test("updates chart when slider value changes", async () => { + const chartData = [ + { feature1: "Group1", feature2: "Label1", accuracy: 0.8, falsepositive: 0.1, falsenegative: 0.1 }, + { feature1: "Group2", feature2: "Label2", accuracy: 0.7, falsepositive: 0.2, falsenegative: 0.1 }, + ]; + let sliderValue = 0.75; + + const { rerender } = render(); + + // Initially, check the chart rendering with the first slider value + const chartCanvas = screen.getByTestId("chart-canvas"); + expect(chartCanvas).toBeInTheDocument(); + + // Change the slider value and rerender the component + sliderValue = 0.85; + rerender(); + + // Check if the chart updates after the slider value changes + expect(chartCanvas).toBeInTheDocument(); +}); + + +test("calls downloadChart function when invoked", () => { + const chartData = [ + { feature1: "Group1", feature2: "Label1", accuracy: 0.8, falsepositive: 0.1, falsenegative: 0.1 }, + { feature1: "Group2", feature2: "Label2", accuracy: 0.7, falsepositive: 0.2, falsenegative: 0.1 }, + ]; + const sliderValue = 0.75; + + const ref = React.createRef(); + render(); + + // Mock download logic + const downloadSpy = jest.spyOn(ref.current, "downloadChart"); + + // Call downloadChart function via ref + act(() => { + ref.current.downloadChart(); + }); + + // Verify the download function was called + expect(downloadSpy).toHaveBeenCalledTimes(1); +}); diff --git a/frontend/tests/Layout/PublicLayout.test.jsx b/frontend/tests/Layout/PublicLayout.test.jsx new file mode 100644 index 00000000..a93f62f3 --- /dev/null +++ b/frontend/tests/Layout/PublicLayout.test.jsx @@ -0,0 +1,32 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { BrowserRouter } from "react-router-dom"; +import PublicLayout from "../../src/Layout/PublicLayout"; + +jest.mock("react-router-dom", () => ({ + ...jest.requireActual("react-router-dom"), + Outlet: () =>
, +})); + +describe("PublicLayout Component", () => { + test("renders Navbar component", () => { + render( + + + + ); + + expect(screen.getByRole("navigation")).toBeInTheDocument(); + }); + + test("renders Outlet component for child routes", () => { + render( + + + + ); + + expect(screen.getByTestId("outlet")).toBeInTheDocument(); + }); +}); diff --git a/frontend/tests/Layout/UserLayout.test.jsx b/frontend/tests/Layout/UserLayout.test.jsx new file mode 100644 index 00000000..cfd166d5 --- /dev/null +++ b/frontend/tests/Layout/UserLayout.test.jsx @@ -0,0 +1,23 @@ +import React from "react"; +import { render, screen, fireEvent } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { BrowserRouter, Route, Routes } from "react-router-dom"; +import UserLayout from "../../src/Layout/UserLayout"; + +// Mock the envConfig module to simulate environment variables during testing +jest.mock("../../src/envConfig", () => ({ + envConfig: () => "test", // Mocked envConfig response +})); + +describe("UserLayout Component", () => { + test("renders UserNavbar component", () => { + render( + + + + ); + // Ensure UserNavbar is rendered by checking for the navigation role + expect(screen.getByRole("navigation")).toBeInTheDocument(); + }); + +}); diff --git a/frontend/tests/SharePage.test.jsx b/frontend/tests/SharePage.test.jsx new file mode 100644 index 00000000..22500d8c --- /dev/null +++ b/frontend/tests/SharePage.test.jsx @@ -0,0 +1,94 @@ +import React from "react"; +import { render, screen, waitFor } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { MemoryRouter } from "react-router-dom"; +import SharePage from "../src/pages/SharePage/SharePage"; + +global.fetch = jest.fn(() => + Promise.resolve({ + json: () => + Promise.resolve({ + other_data: { + currUser: "testuser@example.com", + timeframe: "weekly", + selectedDemographic: "Age", + selectedValues: ["18-25", "26-35"], + selectedSecondValues: ["Male", "Female"], + secondSelectedDemographic: "Gender", + }, + graph_data: [ + { accuracy: 0.8, falsepositive: 0.1, falsenegative: 0.1 }, + { accuracy: 0.7, falsepositive: 0.15, falsenegative: 0.05 }, + ], + }), + }) +); + +jest.mock("../src/envConfig", () => ({ + envConfig: () => { + return "test"; + }, +})); + +beforeEach(() => { + fetch.mockClear(); +}); + +test("displays an error message if no data is found", async () => { + + fetch.mockResolvedValueOnce({ + json: () => + Promise.resolve({ + other_data: null, + graph_data: [], + }), + }); + + render( + + + + ); + + await waitFor(() => { + expect( + screen.getByText(/No encoded data found in URL./i) + ).toBeInTheDocument(); + }); +}); + +test("calculates and displays average bias correctly", async () => { + render( + + + + ); + + await waitFor(() => { + + if (screen.queryByText(/No encoded data found in URL./)) { + expect(screen.getByText(/No encoded data found in URL./)).toBeInTheDocument(); + } else { + + expect(screen.getByText(/Overall Bias:/i)).toBeInTheDocument(); + expect(screen.getByText(/0.75/)).toBeInTheDocument(); // Based on mock data + } + }); +}); + +test("checks if the chart is rendered", async () => { + render( + + + + ); + + await waitFor(() => { + + if (screen.queryByTestId("chart-canvas")) { + expect(screen.getByTestId("chart-canvas")).toBeInTheDocument(); + } else { + expect(screen.getByText(/No encoded data found in URL./i)).toBeInTheDocument(); + } + }); +}); diff --git a/frontend/tests/UserLogin.test.jsx b/frontend/tests/UserLogin.test.jsx new file mode 100644 index 00000000..76da3690 --- /dev/null +++ b/frontend/tests/UserLogin.test.jsx @@ -0,0 +1,115 @@ +import React from "react"; +import { render, screen, fireEvent, waitFor } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { act } from "react-dom/test-utils"; +import { MemoryRouter } from "react-router-dom"; +import UserLogin from "../src/pages/UserLogin/UserLogin"; + + +global.fetch = jest.fn(() => + Promise.resolve({ + json: () => Promise.resolve({ error: false, message: "Login successful" }), + }) +); + +jest.mock("../src/envConfig", () => ({ + envConfig: () => { + return "test"; + }, +})); + +beforeEach(() => { + fetch.mockClear(); +}); + + +test("renders UserLogin form", () => { + render( + {/* Wrap with MemoryRouter */} + + + ); + + // Verify the presence of form elements + expect(screen.getByLabelText("Email")).toBeInTheDocument(); + expect(screen.getByLabelText("Password")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /Login/i })).toBeInTheDocument(); +}); + +test("submits form with valid data", async () => { + render( + {/* Wrap with MemoryRouter */} + + + ); + + await act(async () => { + fireEvent.change(screen.getByLabelText("Email"), { + target: { value: "test@example.com" }, + }); + fireEvent.change(screen.getByLabelText("Password"), { + target: { value: "password123" }, + }); + + fireEvent.click(screen.getByRole("button", { name: /Login/i })); + }); + + + expect(fetch).toHaveBeenCalledWith( + expect.stringContaining("test/login"), + expect.objectContaining({ + method: "POST", + body: JSON.stringify({ + email: "test@example.com", + password: "password123", + }), + headers: { "Content-Type": "application/json" }, + }) + ); +}); + +test("shows error message on failed login", async () => { + // Mock fetch to simulate a failed login + fetch.mockResolvedValueOnce({ + json: () => Promise.resolve({ error: true, message: "Invalid credentials" }), + }); + + render( + {/* Wrap with MemoryRouter */} + + + ); + + await act(async () => { + fireEvent.change(screen.getByLabelText("Email"), { + target: { value: "test@example.com" }, + }); + fireEvent.change(screen.getByLabelText("Password"), { + target: { value: "wrongpassword" }, + }); + + fireEvent.click(screen.getByRole("button", { name: /Login/i })); + }); + + // Verify that the error message is displayed + await waitFor(() => expect(screen.getByText("Invalid credentials")).toBeInTheDocument()); +}); + + +test('handles form validation errors', async () => { + render( + + + + ); + + fireEvent.click(screen.getByRole("button", { name: /Login/i })); + + await waitFor(() => { + const errorMessages = screen.getAllByText("This field is required"); + + expect(errorMessages).toHaveLength(2); + expect(errorMessages[0]).toBeInTheDocument(); + expect(errorMessages[1]).toBeInTheDocument(); + }); +}); diff --git a/frontend/tests/UserSignup.test.jsx b/frontend/tests/UserSignup.test.jsx new file mode 100644 index 00000000..2e4b53af --- /dev/null +++ b/frontend/tests/UserSignup.test.jsx @@ -0,0 +1,199 @@ +import React from "react"; +import { render, screen, fireEvent, waitFor } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import { act } from "react-dom/test-utils"; +import { MemoryRouter } from "react-router-dom"; // Import MemoryRouter +import UserSignup from "../src/pages/UserSignup/UserSignup"; + +global.fetch = jest.fn(() => + Promise.resolve({ + json: () => Promise.resolve({ error: false, message: "Signup successful" }), + }) +); + +jest.mock("../src/envConfig", () => ({ + envConfig: () => { + return "test"; + }, +})); + +beforeEach(() => { + fetch.mockClear(); +}); + +// Test case for rendering the form +test("renders UserSignup form", () => { + render( + {/* Wrap with MemoryRouter */} + + + ); + + expect(screen.getByLabelText("First Name")).toBeInTheDocument(); + expect(screen.getByLabelText("Last Name")).toBeInTheDocument(); + expect(screen.getByLabelText("Email")).toBeInTheDocument(); + expect(screen.getByLabelText("Password")).toBeInTheDocument(); + expect(screen.getByLabelText("Confirm Password")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /Submit/i })).toBeInTheDocument(); +}); + +test("submits form with valid data", async () => { + render( + {/* Wrap with MemoryRouter */} + + + ); + + await act(async () => { + fireEvent.change(screen.getByLabelText("First Name"), { + target: { value: "John" }, + }); + fireEvent.change(screen.getByLabelText("Last Name"), { + target: { value: "Doe" }, + }); + fireEvent.change(screen.getByLabelText("Email"), { + target: { value: "test@example.com" }, + }); + fireEvent.change(screen.getByLabelText("Password"), { + target: { value: "password123" }, + }); + fireEvent.change(screen.getByLabelText("Confirm Password"), { + target: { value: "password123" }, + }); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + }); + + expect(fetch).toHaveBeenCalledWith( + expect.stringContaining("test/signup"), + expect.objectContaining({ + method: "POST", + body: JSON.stringify({ + firstname: "John", + lastname: "Doe", + email: "test@example.com", + password: "password123", + confirmPassword: "password123", + }), + headers: { "Content-Type": "application/json" }, + }) + ); +}); + + +test("shows error message on failed signup", async () => { + + fetch.mockResolvedValueOnce({ + json: () => Promise.resolve({ error: true, message: "Signup failed" }), + }); + + render( + {/* Wrap with MemoryRouter */} + + + ); + + await act(async () => { + fireEvent.change(screen.getByLabelText("First Name"), { + target: { value: "John" }, + }); + fireEvent.change(screen.getByLabelText("Last Name"), { + target: { value: "Doe" }, + }); + fireEvent.change(screen.getByLabelText("Email"), { + target: { value: "test@example.com" }, + }); + fireEvent.change(screen.getByLabelText("Password"), { + target: { value: "password123" }, + }); + fireEvent.change(screen.getByLabelText("Confirm Password"), { + target: { value: "password123" }, + }); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + }); + + await waitFor(() => expect(screen.getByText("Signup failed")).toBeInTheDocument()); +}); + +test('handles form validation errors', async () => { + render( + + + + ); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + + await waitFor(() => { + const errorMessages = screen.getAllByText("This field is required"); + + expect(errorMessages).toHaveLength(3); + expect(errorMessages[0]).toBeInTheDocument(); + expect(errorMessages[1]).toBeInTheDocument(); + expect(errorMessages[2]).toBeInTheDocument(); + + }); +}); + +test('shows validation error messages for required fields', async () => { + render( + + + + ); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + + await waitFor(() => { + const errorMessages = screen.getAllByText("This field is required"); + expect(errorMessages).toHaveLength(3); // Password, Confirm Password, and Email fields + expect(errorMessages[0]).toBeInTheDocument(); + expect(errorMessages[1]).toBeInTheDocument(); + expect(errorMessages[2]).toBeInTheDocument(); + }); +}); + +test("shows success message on successful form submission", async () => { + render( + + + + ); + + // Simulate form submission + fireEvent.change(screen.getByLabelText("First Name"), { target: { value: "John" } }); + fireEvent.change(screen.getByLabelText("Last Name"), { target: { value: "Doe" } }); + fireEvent.change(screen.getByLabelText("Email"), { target: { value: "test@example.com" } }); + fireEvent.change(screen.getByLabelText("Password"), { target: { value: "password123" } }); + fireEvent.change(screen.getByLabelText("Confirm Password"), { target: { value: "password123" } }); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + + await waitFor(() => { + expect(screen.getByText("Signup successful")).toBeInTheDocument(); + }); +}); + +test("shows error when passwords do not match", async () => { + render( + + + + ); + + // Simulate typing in the form + fireEvent.change(screen.getByLabelText("First Name"), { target: { value: "John" } }); + fireEvent.change(screen.getByLabelText("Last Name"), { target: { value: "Doe" } }); + fireEvent.change(screen.getByLabelText("Email"), { target: { value: "test@example.com" } }); + fireEvent.change(screen.getByLabelText("Password"), { target: { value: "password123" } }); + fireEvent.change(screen.getByLabelText("Confirm Password"), { target: { value: "differentPassword" } }); + + fireEvent.click(screen.getByRole("button", { name: /Submit/i })); + + await waitFor(() => { + expect(screen.getByText("Passwords do not match")).toBeInTheDocument(); + }); +}); + +