-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigating to org details from unrelated paths now redirects the user…
… back to the contact page (#1654) * Navigating to org details from unrelated paths now redirects the user back to the contact page * Fix 500 error when navigating to /contact/organization-details * Re-arrange some route validation logic * fix test * Formatting * Fix issue navigating to org details after selecting a non-demo support_type * formatting * Revert unintended commit of files * Restore edited devcontainer.json
- Loading branch information
Showing
2 changed files
with
42 additions
and
17 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 |
---|---|---|
|
@@ -92,29 +92,50 @@ def test_back_link_goes_to_previous_step(client_request): | |
@pytest.mark.parametrize( | ||
"view, expected_view, request_data", | ||
[ | ||
(".demo_organization_details", ".contact", [{}]), | ||
(".demo_organization_details", ".contact", {}), | ||
( | ||
".demo_organization_details", | ||
".contact", | ||
{ | ||
"name": "John", | ||
"email_address": "[email protected]", | ||
"support_type": "Bad_support_type", | ||
}, | ||
), | ||
( | ||
".demo_organization_details", | ||
".contact", | ||
{ | ||
"name": "John", | ||
"email_address": "[email protected]", | ||
"support_type": "other", | ||
}, | ||
), | ||
( | ||
".demo_organization_details", | ||
".contact", | ||
{ | ||
"name": "John", | ||
"email_address": "[email protected]", | ||
"support_type": "ask_question", | ||
}, | ||
), | ||
( | ||
".demo_primary_purpose", | ||
".contact", | ||
[ | ||
{ | ||
"name": "John", | ||
"email_address": "[email protected]", | ||
"support_type": "demo", | ||
}, | ||
{}, | ||
], | ||
{ | ||
"name": "John", | ||
"email_address": "[email protected]", | ||
"support_type": "demo", | ||
}, | ||
), | ||
(".message", ".contact", [{}]), | ||
(".message", ".contact", {}), | ||
], | ||
) | ||
def test_nav_to_invalid_step_redirects_to_contact(client_request, view, expected_view, request_data): | ||
with client_request.session_transaction() as session: | ||
for data in request_data: | ||
session["contact_form"] = data | ||
client_request.get_url( | ||
url_for(view), _expected_status=302, _test_page_title=False, _expected_redirect=url_for(".contact") | ||
) | ||
session["contact_form"] = request_data | ||
client_request.get_url(url_for(view), _expected_status=302, _test_page_title=False, _expected_redirect=url_for(".contact")) | ||
|
||
|
||
@pytest.mark.parametrize("support_type", ["ask_question", "technical_support", "give_feedback", "other"]) | ||
|