-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding docstrings to snapshot report output
- Loading branch information
1 parent
63e9e98
commit 4e8e69c
Showing
2 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,12 @@ | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous"> | ||
<style> | ||
#page-header { | ||
background: #983DE7; | ||
background: linear-gradient(to right, #983DE7 0%, #EC22BD 100%); | ||
-webkit-background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
} | ||
.overlay-container { | ||
position: relative; | ||
} | ||
|
@@ -18,15 +24,15 @@ | |
} | ||
</style> | ||
</head> | ||
<body> | ||
<body class="bg-dark text-white"> | ||
|
||
<div class="container-fluid"> | ||
<div class="row mb-4" style="background-color:#F4F8F7;"> | ||
<div class="row mb-4"> | ||
<div class="col-8 p-4"> | ||
<h4> | ||
<h4 id="page-header"> | ||
<strong>Posting</strong> Snapshot Tests | ||
</h4> | ||
<span class="text-muted">Showing diffs for {{ fails }} mismatched snapshot(s)</span> | ||
<span class="text-white opacity-50">Showing diffs for {{ fails }} mismatched snapshot(s)</span> | ||
</div> | ||
<div class="col p-4"> | ||
<div class="w-100 d-flex justify-content-end mb-1 mt-2"> | ||
|
@@ -53,7 +59,7 @@ | |
{% for diff in diffs %} | ||
<div class="row mb-4"> | ||
<div class="col"> | ||
<div class="card"> | ||
<div class="card text-white bg-dark border-secondary rounded-0"> | ||
<div class="card-header d-flex justify-content-between"> | ||
<span class="font-monospace mt-1"> | ||
<span class="fw-bold">{{ diff.test_name }}</span> | ||
|
@@ -62,7 +68,7 @@ | |
</span> | ||
</span> | ||
{% if diff.snapshot != "" %} | ||
<div class="form-check form-switch mt-1"> | ||
<div class="form-check form-switch mt-1 bg-dark"> | ||
<input class="form-check-input" type="checkbox" role="switch" | ||
id="flexSwitchCheckDefault{{ loop.index0 }}" onchange="toggleOverlayCheckbox(this, {{ loop.index0 }})"> | ||
<label class="form-check-label text-muted" for="flexSwitchCheckDefault{{ loop.index0 }}"> | ||
|
@@ -75,10 +81,15 @@ | |
<div class="row"> | ||
<div class="col"> | ||
{{ diff.actual }} | ||
<div class="w-100 d-flex justify-content-center mt-1"> | ||
<span class="small">Output from test (<a href="#" class="link-primary mb-0" | ||
data-bs-toggle="modal" | ||
data-bs-target="#environmentModal{{ loop.index0 }}">More info</a>)</span> | ||
<div class="w-100 d-flex flex-column justify-content-center align-items-center mt-1"> | ||
<div class="small opacity-75">{{ diff.docstring }}</div> | ||
<div class="small"> | ||
<a href="#" class="mb-0 text-primary" | ||
data-bs-toggle="modal" | ||
data-bs-target="#environmentModal{{ loop.index0 }}"> | ||
View environment info | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
|
@@ -125,7 +136,7 @@ | |
aria-labelledby="environmentModalLabel{{ loop.index0 }}" | ||
aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-content bg-dark text-white"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="environmentModalLabel{{ loop.index0 }}">More info for <span | ||
class="font-monospace">{{ diff.test_name }}</span></h5> | ||
|
@@ -134,7 +145,7 @@ | |
</div> | ||
<div class="modal-body overflow-auto"> | ||
<h5>Textual App State</h5> | ||
<table class="table mb-4"> | ||
<table class="table mb-4 text-white"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Variable</th> | ||
|
@@ -153,7 +164,7 @@ | |
</tbody> | ||
</table> | ||
<h5>Environment (<span class="font-monospace">os.environ</span>)</h5> | ||
<table class="table"> | ||
<table class="table text-white"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Variable</th> | ||
|
@@ -182,9 +193,9 @@ | |
</div> | ||
{% endfor %} | ||
|
||
<div class="row" style="background-color:#F4F8F7;"> | ||
<div class="row"> | ||
<div class="col"> | ||
<div class="card bg-light"> | ||
<div class="card text-white bg-dark border-secondary rounded-0"> | ||
<div class="card-body"> | ||
<p class="card-text">If you're happy with the test output, run <span class="font-monospace text-primary">pytest</span> with the <span | ||
class="font-monospace text-primary">--snapshot-update</span> flag to update the snapshot. | ||
|