mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui: Do not allow empty pagination size
Pagination size must be required, the current validators are triggered after form is submitted, thus the only way for check if data is not empty is by making the field required. Fixes: https://pagure.io/freeipa/issue/9192 Signed-off-by: Armando Neto <abiagion@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
parent
33cd62e0da
commit
02d3fb8266
@ -318,6 +318,7 @@ define([
|
||||
$type: 'text',
|
||||
name: 'pagination_size',
|
||||
label: '@i18n:customization.table_pagination',
|
||||
required: true,
|
||||
validators: ['positive_integer']
|
||||
}
|
||||
]
|
||||
|
@ -11,6 +11,11 @@ from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
import re
|
||||
|
||||
try:
|
||||
from selenium.webdriver.common.by import By
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class TestMiscCases(UI_driver):
|
||||
@ -26,3 +31,17 @@ class TestMiscCases(UI_driver):
|
||||
ver_re = re.compile('version: .*')
|
||||
assert re.search(ver_re, about_text), 'Version not found'
|
||||
self.dialog_button_click('ok')
|
||||
|
||||
@screenshot
|
||||
def test_customization_pagination_input_required(self):
|
||||
"""Test if 'pagination size' is required when submitting the form."""
|
||||
self.init_app()
|
||||
|
||||
self.profile_menu_action('configuration')
|
||||
self.fill_input('pagination_size', '')
|
||||
self.dialog_button_click('save')
|
||||
|
||||
pagination_size_elem = self.find(
|
||||
".widget[name='pagination_size']", By.CSS_SELECTOR)
|
||||
|
||||
self.assert_field_validation_required(parent=pagination_size_elem)
|
||||
|
Loading…
Reference in New Issue
Block a user