Writing tests for chartDashboard.js

This commit is contained in:
Jonathan Bobel
2024-06-05 11:25:15 -04:00
parent 30b31d61b6
commit c02c9152d8
10 changed files with 607 additions and 176 deletions

View File

@@ -31,7 +31,7 @@
<meta property="og:image" content="/static/images/notify-og-image.png">
{# google #}
<script type="text/javascript" src="{{ asset_url('js/gtm_head.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/chart.umd.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/chart.js') }}"></script>
<meta name="google-site-verification" content="niWnSqImOWz6mVQTYqNb5tFK8HaKSB4b3ED4Z9gtUQ0" />
{% if g.hide_from_search_engines %}
<meta name="robots" content="noindex" />

View File

@@ -29,12 +29,16 @@
{{ ajax_block(partials, updates_url, 'template-statistics') }}
{% if current_user.has_permissions('manage_service') %}
<div id="chartContainer" data-sms-sent="{{ sms_sent }}" data-sms-allowance-remaining="{{ sms_allowance_remaining }}">
<h3 class="margin-bottom-1" id="chartTitle">2024 Total Message Allowance</h3>
<h2 class="margin-bottom-1" id="chartTitle">2024 Total message allowance</h2>
<div class="usa-sr-only" id="chartDesc">A bar chart showing the messages sent against the total message allowance for 2024 to date</div>
<canvas id="totalMessageChart" role="img" aria-labelledby="chartTitle chartDesc" height="100"></canvas>
<div id="totalMessageTable"></div>
</div>
<div id="message"></div>
<p class="align-with-heading-copy">
What counts as 1 text message part?<br />
See <a class="usa-link" href="{{ url_for('.pricing') }}">pricing</a>.
</p>
{% endif %}
<h2 class="margin-top-4 margin-bottom-1">Recent Batches</h2>
@@ -105,7 +109,7 @@
</table>
</div>
<h2 class="margin-top-4 margin-bottom-1">Message count</h2>
{# <h2 class="margin-top-4 margin-bottom-1">Message count</h2>
{% if current_user.has_permissions('manage_service') %}
<h3 class='margin-bottom-0' id="current-year"></h3>
{{ ajax_block(partials, updates_url, 'usage') }}
@@ -115,7 +119,7 @@
What counts as 1 text message part?<br />
See <a class="usa-link" href="{{ url_for('.pricing') }}">pricing</a>.
</p>
{% endif %}
{% endif %} #}
</div>
{% endblock %}