fix: repair admin directory filter layout
This commit is contained in:
@@ -67,6 +67,23 @@ def main():
|
||||
expect(page.get_by_role("status")).to_have_text("Показаны 26–30 из 30")
|
||||
assert page.locator("th:visible").count() == 5
|
||||
assert page.locator(".directory__table-wrap").evaluate("e => e.scrollWidth <= e.clientWidth")
|
||||
skip_link = page.get_by_role("link", name="Перейти к содержимому")
|
||||
assert skip_link.evaluate("e => getComputedStyle(e).left === '-999px'")
|
||||
page.keyboard.press("Tab")
|
||||
expect(skip_link).to_be_focused()
|
||||
assert skip_link.evaluate("e => getComputedStyle(e).left === '8px'")
|
||||
page.keyboard.press("Tab")
|
||||
assert skip_link.evaluate("e => getComputedStyle(e).left === '-999px'")
|
||||
|
||||
for width in (1440, 1024, 921, 920, 768, 621, 620, 390, 320):
|
||||
page.set_viewport_size({"width": width, "height": 844})
|
||||
assert page.locator(".directory__filters").evaluate("e => e.scrollWidth <= e.clientWidth")
|
||||
assert page.locator(".directory__input").evaluate_all("""controls => controls.every(control => {
|
||||
const field = control.closest('.directory__field').getBoundingClientRect();
|
||||
const rect = control.getBoundingClientRect();
|
||||
return rect.left >= field.left - 1 && rect.right <= field.right + 1;
|
||||
})""")
|
||||
page.set_viewport_size({"width": 1440, "height": 1000})
|
||||
page.get_by_label("ФИО или ссылка").fill("Сотрудник 00")
|
||||
page.get_by_role("button", name="Применить фильтры").click()
|
||||
expect(page.get_by_role("status")).to_have_text("Показаны 1–1 из 1")
|
||||
|
||||
Reference in New Issue
Block a user