Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Add new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cduhn17 committed May 25, 2022
1 parent c916f2f commit 41f7c41
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
<div class="container">
<img
src="{{ url_for('static', filename='CISAImage.png') }}"
alt="Cinque Terre"
alt="CISA seal image"
width="200"
height="200"
/>
<div id="loading" class="justify-content-lg-center"></div>
<div class="row justify-content-lg-center">
<div class="row col-lg-6 offset-lg-3">
<input
type="hidden"
value="{% block title %} Stakeholder {% endblock%}"
/>

<button type="button" class="btn btn-primary" onclick="showDiv()">
Add External Stakeholder
</button>
Expand Down
4 changes: 4 additions & 0 deletions src/pe_reports/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ div#loading {
background: url("../SVG-Loaders/svg-loaders/bars.svg") no-repeat;
cursor: wait;
}

homeBG {
background-color: white;
}
2 changes: 1 addition & 1 deletion src/pe_reports/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>P&E Add Customers</title>
<title>{% block title %} {% endblock %} - P&E Application</title>

<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
Expand Down
84 changes: 50 additions & 34 deletions src/pe_reports/templates/home.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
{% extends "base.html" %} {% block content %}

<div class="container">
<img
src="{{ url_for('static', filename='CISAImage.png') }}"
alt="CISA seal image"
width="200"
height="200"
/>
</div>
<!--End of container-->
<script>
function showDiv() {
let T = document.getElementById("TestsDiv"),
displayValue = "";
if (T.style.display == "") displayValue = "none";
T.style.display = displayValue;
}

function loading() {
$("#loading").show();
$("#content").hide();
}

$(document).ready(function () {
console.log("Im ready ");

showDiv();

setTimeout(function () {
$("#messageDiv").fadeOut("fast");
}, 5000);
$(window).load(function () {
$("#loading").hide();
<div class="row">
<div class="col-lg-3">
<img
src="{{ url_for('static', filename='CISAImage.png') }}"
alt="CISA seal image"
width="200"
height="200"
/>
</div>
<input type="hidden" value="{% block title %} Home {% endblock%}" />

<div class="col-lg-9 homeBG" style="background-color: white">
<p>
Posture and Exposure (P&E) offers stakeholders an opportunity to view
their organizational riskfrom the viewpoint of the adversary. We utilize
passive reconnaissance services, dark webanalysis, and open-source tools
to identify spoofing in order to generate a risk profile report thatis
delivered on a regular basis.
</p>
</div>
</div>

<!--End of container-->
<script>
function showDiv() {
let T = document.getElementById("TestsDiv"),
displayValue = "";
if (T.style.display == "") displayValue = "none";
T.style.display = displayValue;
}

function loading() {
$("#loading").show();
$("#content").hide();
}

$(document).ready(function () {
console.log("Im ready ");

showDiv();

setTimeout(function () {
$("#messageDiv").fadeOut("fast");
}, 5000);
$(window).load(function () {
$("#loading").hide();
});
});
});
</script>
</script>

{% endblock %}
{% endblock %}
</div>
10 changes: 7 additions & 3 deletions tests/test_pe_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"critical",
)


PROJECT_VERSION = pe_reports.__version__


Expand Down Expand Up @@ -117,13 +116,18 @@ def client():
yield client


# TODO: Increase flask UI testing to test Cyber Six Gill API responses. The
# current state of the CSG API times out randomly.
# See https://github.com/cisagov/pe-reports/issues/213
def test_home_page(client):
"""Test flask home.html."""
"""Test flask home.html is avalible and verify the correct page."""
resp = client.get("/")
assert resp.status_code == 200
assert b"Home" in resp.data


def test_stakeholder_page(client):
"""Test flask home_stakeholder.html."""
"""Test flask home_stakeholder.html and verify the correct page."""
resp = client.get("/stakeholder")
assert resp.status_code == 200
assert b"Stakeholder" in resp.data

0 comments on commit 41f7c41

Please sign in to comment.