From dd47904b9d1c009e5711838e108dcbad98512bdf Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 22 May 2024 13:15:30 +1200 Subject: [PATCH] FIX Ensure tab is highlighted for validation error --- code/Forms/FormMessageBootstrapAdapter.php | 1 + tests/behat/features/multitab-validation.feature | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/code/Forms/FormMessageBootstrapAdapter.php b/code/Forms/FormMessageBootstrapAdapter.php index 2be2bf2ad..e3c3c32dc 100644 --- a/code/Forms/FormMessageBootstrapAdapter.php +++ b/code/Forms/FormMessageBootstrapAdapter.php @@ -18,6 +18,7 @@ class FormMessageBootstrapExtension extends Extension 'good' => 'alert-success', 'bad' => 'alert-danger', 'required' => 'alert-danger', + 'validation' => 'alert-danger validation', 'warning' => 'alert-warning', ]; diff --git a/tests/behat/features/multitab-validation.feature b/tests/behat/features/multitab-validation.feature index 36ad0059e..cb4735357 100644 --- a/tests/behat/features/multitab-validation.feature +++ b/tests/behat/features/multitab-validation.feature @@ -24,6 +24,12 @@ Feature: Multi-tab page validation icons When I press the "Save" button Then I can see the form validation error message Then I should not see an invalid tab icon on the "Second" tab + Then I should see an invalid tab icon on the "Third" tab + Then I should see an invalid tab icon on the "Fourth" tab + And I fill in "Third tab first field" with "abc@example.com" + When I press the "Save" button + Then I can see the form validation error message + Then I should not see an invalid tab icon on the "Second" tab Then I should not see an invalid tab icon on the "Third" tab Then I should see an invalid tab icon on the "Fourth" tab When I click on the "#tab-Root_Fourth" element