Form and theme improvements (#513)
This commit is contained in:
@@ -240,13 +240,11 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
'activity_edit_form' => [
|
||||
'name' => '',
|
||||
'project' => 0,
|
||||
'visible' => 3,
|
||||
]
|
||||
],
|
||||
[
|
||||
'#activity_edit_form_name',
|
||||
'#activity_edit_form_project',
|
||||
'#activity_edit_form_visible',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
@@ -212,7 +212,6 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
[
|
||||
'customer_edit_form' => [
|
||||
'name' => '',
|
||||
'visible' => 3,
|
||||
'country' => '00', // TODO why does it not fail?
|
||||
'currency' => '00', // TODO why does it not fail?
|
||||
'timezone' => 'XXX'
|
||||
@@ -220,7 +219,6 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
],
|
||||
[
|
||||
'#customer_edit_form_name',
|
||||
'#customer_edit_form_visible',
|
||||
//'#customer_edit_form_country',
|
||||
//'#customer_edit_form_currency',
|
||||
'#customer_edit_form_timezone',
|
||||
|
||||
@@ -236,13 +236,11 @@ class ProjectControllerTest extends ControllerBaseTest
|
||||
'project_edit_form' => [
|
||||
'name' => '',
|
||||
'customer' => 0,
|
||||
'visible' => 3,
|
||||
]
|
||||
],
|
||||
[
|
||||
'#project_edit_form_name',
|
||||
'#project_edit_form_customer',
|
||||
'#project_edit_form_visible',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
@@ -132,14 +132,12 @@ class UserControllerTest extends ControllerBaseTest
|
||||
'title' => '34rtwrtewrt',
|
||||
'avatar' => 'asdfawer',
|
||||
'email' => 'ydfbvsdfgs',
|
||||
'enabled' => '3',
|
||||
]
|
||||
],
|
||||
[
|
||||
'#user_create_username',
|
||||
'#user_create_plainPassword_first',
|
||||
'#user_create_email',
|
||||
'#user_create_enabled',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
@@ -210,8 +210,14 @@ abstract class ControllerBaseTest extends WebTestCase
|
||||
$this->assertNotNull($field, 'Could not find form field: ' . $name);
|
||||
$list = $field->nextAll();
|
||||
$this->assertNotNull($list, 'Form field has no validation message: ' . $name);
|
||||
|
||||
$validation = $list->filter('li.text-danger');
|
||||
$this->assertGreaterThanOrEqual(1, count($validation), 'Form field has no validation message: ' . $name);
|
||||
if (count($validation) < 1) {
|
||||
// decorated form fields with icon have a different html structure, see kimai-theme.html.twig
|
||||
$classes = $field->parents()->getNode(1)->getAttribute('class');
|
||||
$this->assertContains('has-feedback', $classes, 'Form field has no validation message: ' . $name);
|
||||
$this->assertContains('has-error', $classes, 'Form field has no validation message: ' . $name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
'title' => 'Code Monkey',
|
||||
'avatar' => '/fake/image.jpg',
|
||||
'email' => 'updated@example.com',
|
||||
'enabled' => 0,
|
||||
'enabled' => false,
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user