From 4fdf6f68c6106aae262d3d12f8d11d339f2a2303 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Fri, 29 Dec 2023 06:53:03 -0500 Subject: [PATCH] added test to ensure intro is skipped when editing --- src/registrar/tests/test_views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 69b0a3b9a..8f37b865f 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -142,6 +142,19 @@ class DomainApplicationTests(TestWithUser, WebTest): intro_page = self.app.get(reverse("application:")) self.assertContains(intro_page, "You're about to start your .gov domain request") + def test_application_form_intro_is_skipped_when_edit_access(self): + """Tests that user is NOT presented with intro acknowledgement page when accessed through 'edit'""" + completed_application(status=DomainApplication.ApplicationStatus.STARTED, user=self.user) + home_page = self.app.get("/") + self.assertContains(home_page, "city.gov") + # click the "Edit" link + detail_page = home_page.click("Edit", index=0) + # Check that the response is a redirect + self.assertEqual(detail_page.status_code, 302) + # You can access the 'Location' header to get the redirect URL + redirect_url = detail_page.url + self.assertEqual(redirect_url, "/register/organization_type/") + def test_application_form_empty_submit(self): """Tests empty submit on the first page after the acknowledgement page""" intro_page = self.app.get(reverse("application:"))