fixed testing

This commit is contained in:
Beverly Nguyen
2024-06-24 15:33:48 -07:00
parent 5028054034
commit 44baaf665a
3 changed files with 16 additions and 11 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ def check_tour_notification(service_id, template_id):
"views/notifications/preview.html", "views/notifications/preview.html",
template=template, template=template,
back_link=back_link, back_link=back_link,
help="2", help="3",
) )
+10 -7
View File
@@ -5,7 +5,13 @@
{% from "components/components/button/macro.njk" import usaButton %} {% from "components/components/button/macro.njk" import usaButton %}
{% block service_page_title %} {% block service_page_title %}
{{ "Error" if error else "Preview" }} {% if error %}
{{ "Error" }}
{% elif help %}
{{ "Example text message" }}
{% else %}
{{ "Preview" }}
{% endif %}
{% endblock %} {% endblock %}
{% block backLink %} {% block backLink %}
@@ -44,10 +50,9 @@
{% endcall %} {% endcall %}
</div> </div>
{% else %} {% else %}
{% if not help %} {{ page_header("Example text message" if help else "Preview") }}
{{ page_header('Preview') }}
{% endif %}
{% endif %} {% endif %}
{% if not help %} {% if not help %}
<div> <div>
<p class="sms-message-scheduler">Scheduled: {{ scheduled_for |format_datetime_scheduled_notification if scheduled_for else 'Now'}}</p> <p class="sms-message-scheduler">Scheduled: {{ scheduled_for |format_datetime_scheduled_notification if scheduled_for else 'Now'}}</p>
@@ -57,9 +62,7 @@
</div> </div>
{% endif %} {% endif %}
{% if help %} {% if not help %}
<h1 class="message-header">Example text message</h1>
{% else %}
<h2 class="message-header">Message</h2> <h2 class="message-header">Message</h2>
{% endif %} {% endif %}
+5 -3
View File
@@ -530,10 +530,11 @@ def test_should_200_for_check_tour_notification(
assert normalize_spaces(page.select(".banner-tour .heading-medium")[0].text) == ( assert normalize_spaces(page.select(".banner-tour .heading-medium")[0].text) == (
"Try sending yourself this example" "Try sending yourself this example"
) )
selected_hint = page.select(".banner-tour .grid-row")[1] selected_hint = page.select(".banner-tour .grid-row")[2]
selected_hint_text = normalize_spaces(selected_hint.select(".usa-body")[0].text) selected_hint_text = normalize_spaces(selected_hint.select(".usa-body")[0].text)
print(selected_hint_text)
assert "greyed-out-step" not in selected_hint["class"] assert "greyed-out-step" not in selected_hint["class"]
assert selected_hint_text == "The template pulls in the data you provide" assert selected_hint_text == "Notify delivers the message"
assert normalize_spaces(page.select(".sms-message-recipient")[0].text) == ( assert normalize_spaces(page.select(".sms-message-recipient")[0].text) == (
"To: 202-867-5303" "To: 202-867-5303"
@@ -544,9 +545,10 @@ def test_should_200_for_check_tour_notification(
# post to send_notification keeps help argument # post to send_notification keeps help argument
assert page.form.attrs["action"] == url_for( assert page.form.attrs["action"] == url_for(
"main.preview_notification", "main.send_notification",
service_id=SERVICE_ONE_ID, service_id=SERVICE_ONE_ID,
template_id=fake_uuid, template_id=fake_uuid,
help=3,
) )