1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #33024 -- Fixed height of admin selector boxes in collapsed fieldset.

Thanks Tom Carrick for the review.
This commit is contained in:
Shubh1815
2021-11-15 19:57:11 +05:30
committed by Mariusz Felisiak
parent b8c0b22f2f
commit 51c24d8799
5 changed files with 71 additions and 25 deletions

View File

@@ -4810,6 +4810,49 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertTrue(self.selenium.find_element(By.ID, 'id_title').is_displayed())
self.assertEqual(self.selenium.find_element(By.ID, 'fieldsetcollapser0').text, "Hide")
def test_selectbox_height_collapsible_fieldset(self):
from selenium.webdriver.common.by import By
self.admin_login(
username='super',
password='secret',
login_url=reverse('admin7:index'),
)
url = self.live_server_url + reverse('admin7:admin_views_pizza_add')
self.selenium.get(url)
self.selenium.find_elements(By.LINK_TEXT, 'Show')[0].click()
filter_box = self.selenium.find_element(By.ID, 'id_toppings_filter')
from_box = self.selenium.find_element(By.ID, 'id_toppings_from')
to_box = self.selenium.find_element(By.ID, 'id_toppings_to')
self.assertEqual(
to_box.get_property('offsetHeight'),
(
filter_box.get_property('offsetHeight') +
from_box.get_property('offsetHeight')
),
)
def test_selectbox_height_not_collapsible_fieldset(self):
from selenium.webdriver.common.by import By
self.admin_login(
username='super',
password='secret',
login_url=reverse('admin7:index'),
)
url = self.live_server_url + reverse('admin7:admin_views_question_add')
self.selenium.get(url)
filter_box = self.selenium.find_element(By.ID, 'id_related_questions_filter')
from_box = self.selenium.find_element(By.ID, 'id_related_questions_from')
to_box = self.selenium.find_element(By.ID, 'id_related_questions_to')
self.assertEqual(
to_box.get_property('offsetHeight'),
(
filter_box.get_property('offsetHeight') +
from_box.get_property('offsetHeight')
),
)
def test_first_field_focus(self):
"""JavaScript-assisted auto-focus on first usable form field."""
from selenium.webdriver.common.by import By