Fix (Boilerplate): Add Event Parameter to test, Remove Infosec Requriements, Add Lowercase Requirement (#12)

* Fix missing event, correct example conversion

* Fix unit case

* Remove Infosec items, add lowercase requirement

* Convert to ES6, Update Packages, Fix display

* Applying @nhcarrigan's changes from site tests

* Removed unneeded mongodb ref

* Remove User Stories, Reformat README

* Apply suggestions from code review - Remove "Quality Assurance Project" Prefix

Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

* Re-add the example text, clean up formatting

* Update Favicon

* Fix repo link, remove zombie.js

* Remove unused files, add sample.env

Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
Co-authored-by: Rex Schrader <rex.schader@gmail.com>
This commit is contained in:
Rex Schrader
2020-11-25 07:09:04 -08:00
committed by GitHub
parent 14cd901870
commit 87ebc9c36a
18 changed files with 1085 additions and 1158 deletions
+21 -38
View File
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to HyperDev!</title>
<meta name="description" content="A cool thing made with HyperDev">
<link id="favicon" rel="icon" href="https://hyperdev.com/favicon-app.ico" type="image/x-icon">
<title>Metric/Imperial Converter</title>
<meta name="description" content="An example of the Free Code Camp Metric/Imperial Converter Project">
<link id="favicon" rel="icon" href="https://cdn.freecodecamp.org/universal/favicons/favicon-32x32.png" type="image/x-icon">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -11,47 +11,30 @@
</head>
<body>
<header>
<h1>
ISQA_2 - Metric/Imp Converter
</h1>
<h1>Metric/Imperial Converter</h1>
</header>
<div id='userstories' style='margin-left: 5%; margin-top: 5%'>
<h3>User Stories</h3>
<ol>
<li>I will help prevent the client from trying to guess(sniff) the MIME type.</li>
<li>I will prevent cross-site scripting (XSS) attacks.</li>
<li>I can <b>GET</b> <code>/api/convert</code> with a single parameter containing an accepted number and unit and have it converted.</li>
<li>Hint: Split the input by looking for the index of the first character.</li>
<li>I can convert 'gal' to 'L' and vice versa. <b>(1 gal to 3.78541 L)</b></li>
<li>I can convert 'lbs' to 'kg' and vice versa. <b>(1 lbs to 0.453592 kg)</b></li>
<li>I can convert 'mi' to 'km' and vice versa. <b>(1 mi to 1.60934 km)</b></li>
<li>If my unit of measurement is invalid, returned will be 'invalid unit'.</li>
<li>If my number is invalid, returned with will 'invalid number'.</li>
<li>If both are invalid, return will be 'invalid number and unit'.</li>
<li>I can use fractions, decimals or both in my parameter(ie. 5, 1/2, 2.5/6), but if nothing is provided it will default to 1.</li>
<li>My return will consist of the initNum, initUnit, returnNum, returnUnit, and string spelling out units in format <code>{initNum} {initial_Units} converts to {returnNum} {return_Units}</code> with the result rounded to 5 decimals.</li>
<li>All 16 unit tests are complete and passing.</li>
<li>All 5 functional tests are complete and passing.</li>
</ol>
<h3>Example usage:</h3>
<hr style='margin: 50px'>
<section>
<h3>Example usage</h3>
<code>/api/convert?input=4gal</code><br>
<code>/api/convert?input=1/2km</code><br>
<code>/api/convert?input=5.4/3lbs</code><br>
<code>/api/convert?input=kg</code><br>
<h3>Example return:</h3>
<code>{initNum: 3.1, initUnit: 'mi', returnNum: 5.0000008, returnUnit: 'km', string: '3.1 miles converts to 5.00002 kilometers'}</code>
</div>
<h3>Example return</h3>
<code>{ initNum: 3.1, initUnit: 'mi', returnNum: 4.98895, returnUnit: 'km', string: '3.1 miles converts to 4.98895 kilometers' }</code>
</section>
<hr style='margin: 50px'>
<div id='testui' style='margin-left: 5%'>
<h2 style="text-align: left">Front-End:</h2>
<form id="convertForm" class="border">
<input type="text" id="convertField" name="input" placeholder="3.1mi" style="width: 200px">
<input id="convert" type="submit" value='Convert!'>
</form>
<p id='result'></p>
<code id='jsonResult'></code>
</div>
<hr style='margin: 50px; margin-top: 200px'>
<section>
<div id='testui' >
<h3 style="text-align: left">Front-End</h3>
<form id="convertForm" class="border">
<input type="text" id="convertField" name="input" placeholder="3.1mi" style="width: 200px">
<input id="convert" type="submit" value='Convert!'>
</form>
<p id='result'></p>
<code id='jsonResult'></code>
</div>
</section>
<!-- Your web-app is https, so your scripts need to be too -->
<script src="https://code.jquery.com/jquery-2.2.1.min.js"
integrity="sha256-gvQgAFzTH6trSrAWoH1iPo9Xc96QxSZ3feW6kem+O00="