New unit tests

This commit is contained in:
zandercymatics 2024-04-01 14:21:35 -06:00
parent 65a23fc51e
commit 277198c0aa
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -1319,7 +1319,6 @@ class TestDomainRequestAdmin(MockEppLib):
("title", "Admin Tester"), ("title", "Admin Tester"),
("email", "mayor@igorville.gov"), ("email", "mayor@igorville.gov"),
("phone", "(555) 555 5556"), ("phone", "(555) 555 5556"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_submitter_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_submitter_fields)
self.assertContains(response, "Testy2 Tester2") self.assertContains(response, "Testy2 Tester2")
@ -1328,10 +1327,9 @@ class TestDomainRequestAdmin(MockEppLib):
expected_email = "testy@town.com" expected_email = "testy@town.com"
expected_ao_fields = [ expected_ao_fields = [
# Field, expected value # Field, expected value
("title", "Chief Tester</td>"), ("title", "Chief Tester"),
("email", "testy@town.com</td>"), ("email", "testy@town.com"),
("phone", "(555) 555 5555</td>"), ("phone", "(555) 555 5555"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_ao_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_ao_fields)
@ -1346,10 +1344,12 @@ class TestDomainRequestAdmin(MockEppLib):
("title", "Another Tester"), ("title", "Another Tester"),
("email", "testy2@town.com"), ("email", "testy2@town.com"),
("phone", "(555) 555 5557"), ("phone", "(555) 555 5557"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_other_employees_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_other_employees_fields)
# Test for the copy link
self.assertContains(response, "usa-button__clipboard-link", count=4)
def test_save_model_sets_restricted_status_on_user(self): def test_save_model_sets_restricted_status_on_user(self):
with less_console_noise(): with less_console_noise():
# make sure there is no user with this email # make sure there is no user with this email
@ -2047,7 +2047,6 @@ class TestDomainInformationAdmin(TestCase):
("title", "Admin Tester"), ("title", "Admin Tester"),
("email", "mayor@igorville.gov"), ("email", "mayor@igorville.gov"),
("phone", "(555) 555 5556"), ("phone", "(555) 555 5556"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_submitter_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_submitter_fields)
self.assertContains(response, "Testy2 Tester2") self.assertContains(response, "Testy2 Tester2")
@ -2059,7 +2058,6 @@ class TestDomainInformationAdmin(TestCase):
("title", "Chief Tester"), ("title", "Chief Tester"),
("email", "testy@town.com"), ("email", "testy@town.com"),
("phone", "(555) 555 5555"), ("phone", "(555) 555 5555"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_ao_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_ao_fields)
@ -2074,10 +2072,12 @@ class TestDomainInformationAdmin(TestCase):
("title", "Another Tester"), ("title", "Another Tester"),
("email", "testy2@town.com"), ("email", "testy2@town.com"),
("phone", "(555) 555 5557"), ("phone", "(555) 555 5557"),
("email_copy_button_input", f'<input class="dja-clipboard-input" type="hidden" value="{expected_email}"'),
] ]
self.test_helper.assert_response_contains_distinct_values(response, expected_other_employees_fields) self.test_helper.assert_response_contains_distinct_values(response, expected_other_employees_fields)
# Test for the copy link
self.assertContains(response, "usa-button__clipboard-link", count=4)
def test_readonly_fields_for_analyst(self): def test_readonly_fields_for_analyst(self):
"""Ensures that analysts have their permissions setup correctly""" """Ensures that analysts have their permissions setup correctly"""
with less_console_noise(): with less_console_noise():