mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Merge pull request #1629 from GSA/1256-bug-tour-steps-needs-to-be-adjusted-for-the-new-preview-page
made changes/fixes to tour flow
This commit is contained in:
@@ -66,6 +66,10 @@ h2.sms-message-header {
|
|||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.usa-prose >*+ h2.message-header {
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
h2.recipient-list {
|
h2.recipient-list {
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,10 +195,10 @@ def check_tour_notification(service_id, template_id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"views/notifications/check.html",
|
"views/notifications/preview.html",
|
||||||
template=template,
|
template=template,
|
||||||
back_link=back_link,
|
back_link=back_link,
|
||||||
help="2",
|
help="3",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,21 @@
|
|||||||
{% 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 %}
|
||||||
{{ usaBackLink({ "href": back_link_from_preview }) }}
|
{% if help %}
|
||||||
|
{{ usaBackLink({ "href": back_link }) }}
|
||||||
|
{% else %}
|
||||||
|
{{ usaBackLink({ "href": back_link_from_preview }) }}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
@@ -40,16 +50,23 @@
|
|||||||
{% endcall %}
|
{% endcall %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ page_header('Preview') }}
|
{{ page_header("Example text message" if help else "Preview") }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div>
|
|
||||||
<p class="sms-message-scheduler">Scheduled: {{ scheduled_for |format_datetime_scheduled_notification if scheduled_for else 'Now'}}</p>
|
|
||||||
<p class="sms-message-template">Template: {{template.name}}</p>
|
|
||||||
<p class="sms-message-sender" >From: {{ template.sender }}</p>
|
|
||||||
<p class="sms-message-sender" >To: {{ recipient }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2 id="{{ file_contents_header_id }}">Message</h2>
|
{% if not help %}
|
||||||
|
<div>
|
||||||
|
<p class="sms-message-scheduler">Scheduled: {{ scheduled_for |format_datetime_scheduled_notification if scheduled_for else 'Now'}}</p>
|
||||||
|
<p class="sms-message-template">Template: {{template.name}}</p>
|
||||||
|
<p class="sms-message-sender" >From: {{ template.sender }}</p>
|
||||||
|
<p class="sms-message-sender" >To: {{ recipient }}</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not help %}
|
||||||
|
<h2 class="message-header">Message</h2>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<div class="preview-message"> {{ template|string }}</div>
|
<div class="preview-message"> {{ template|string }}</div>
|
||||||
|
|
||||||
<div class="js-stick-at-bottom-when-scrolling">
|
<div class="js-stick-at-bottom-when-scrolling">
|
||||||
|
|||||||
@@ -530,10 +530,10 @@ 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)
|
||||||
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 +544,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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -256,9 +256,11 @@ def handle_existing_template_case(page):
|
|||||||
# Check to make sure that we've arrived at the next page.
|
# Check to make sure that we've arrived at the next page.
|
||||||
page.wait_for_load_state("domcontentloaded")
|
page.wait_for_load_state("domcontentloaded")
|
||||||
|
|
||||||
preview_button = page.get_by_text("Preview")
|
if "/tour" not in page.url:
|
||||||
expect(preview_button).to_be_visible()
|
# Only execute this part if the current page is not the /tour page
|
||||||
preview_button.click()
|
preview_button = page.get_by_text("Preview")
|
||||||
|
expect(preview_button).to_be_visible()
|
||||||
|
preview_button.click()
|
||||||
|
|
||||||
# Check to make sure that we've arrived at the next page.
|
# Check to make sure that we've arrived at the next page.
|
||||||
page.wait_for_load_state("domcontentloaded")
|
page.wait_for_load_state("domcontentloaded")
|
||||||
|
|||||||
Reference in New Issue
Block a user