test: robustecer validación del centrado responsive en home
Agent-Logs-Url: https://github.com/dsaub/proyecto-final/sessions/8cb9755f-d00d-45ae-ab08-9799aa769175 Co-authored-by: dsaub <54474838+dsaub@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
86bab63749
commit
9a32ee364e
@@ -121,8 +121,6 @@
|
|||||||
|
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 767.98px) {
|
||||||
.hero-section h1 {
|
.hero-section h1 {
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-wrap: balance;
|
text-wrap: balance;
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-4
@@ -1358,11 +1358,21 @@ class EndpointViewTests(TestCase):
|
|||||||
response = self.client.get(url)
|
response = self.client.get(url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_home_includes_mobile_centering_rule_for_welcome_title(self):
|
def test_home_mobile_welcome_title_centered(self):
|
||||||
response = self.client.get(reverse("home"))
|
response = self.client.get(reverse("home"))
|
||||||
self.assertContains(response, "@media (max-width: 767.98px)")
|
html = response.content.decode()
|
||||||
self.assertContains(response, ".hero-section h1")
|
media_idx = html.find("@media (max-width: 767.98px)")
|
||||||
self.assertContains(response, "text-align: center;")
|
self.assertNotEqual(media_idx, -1)
|
||||||
|
|
||||||
|
rule_idx = html.find(".hero-section h1", media_idx)
|
||||||
|
self.assertNotEqual(rule_idx, -1)
|
||||||
|
|
||||||
|
block_end_idx = html.find("}", rule_idx)
|
||||||
|
self.assertNotEqual(block_end_idx, -1)
|
||||||
|
rule_block = html[rule_idx:block_end_idx]
|
||||||
|
|
||||||
|
self.assertIn("text-align: center", rule_block)
|
||||||
|
self.assertIn("text-wrap: balance", rule_block)
|
||||||
|
|
||||||
def test_login_required_endpoints_redirect_anonymous(self):
|
def test_login_required_endpoints_redirect_anonymous(self):
|
||||||
secured_get_routes = [
|
secured_get_routes = [
|
||||||
|
|||||||
Reference in New Issue
Block a user