-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Highlight the tabs which have validation errors (#1753)
- Loading branch information
1 parent
8dc91bd
commit 65c0adb
Showing
7 changed files
with
53 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,34 @@ Feature: Form validation | |
And the "Company" "Vitol" with "Category"="Other" | ||
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Test ModelAdmin' section" and "TEST_DATAOBJECT_EDIT" | ||
And I am logged in as a member of "EDITOR" group | ||
And I go to "/admin/test/SilverStripe-FrameworkTest-Model-Employee" | ||
And I press the "Add Employee" button | ||
|
||
Scenario: Field validation works as expected even if no validator is explicitly declared | ||
Given I go to "/admin/test/SilverStripe-FrameworkTest-Model-Employee" | ||
And I press the "Add Employee" button | ||
When I fill in "Name" with "any name" | ||
And I fill in "Email" with "invalid email" | ||
And I press the "Create" button | ||
Then I should not see "Saved Employee" | ||
And I should see "Please enter an email address" | ||
|
||
And I fill in "Email" with "[email protected]" | ||
When I fill in "Email" with "[email protected]" | ||
And I press the "Create" button | ||
Then I should see "Saved Employee" | ||
And I should not see "Please enter an email address" | ||
|
||
Scenario: Validation in GridField highlights the tab where the error is | ||
Given I go to "/admin/test/SilverStripe-FrameworkTest-Model-Company" | ||
And I click "Walmart" in the "#Form_EditForm" element | ||
When I fill in "Name" with "" | ||
And I press the "Save" button | ||
Then I should not see "Saved Company" | ||
And I should see "\"Name\" is required" | ||
And I should see "There are validation errors on this page, please fix them before saving or publishing." | ||
And I should see an invalid tab icon on the "Main" tab | ||
|
||
When I fill in "Name" with "new name" | ||
And I press the "Save" button | ||
Then I should see "Saved Company" | ||
And I should not see "\"Name\" is required" | ||
And I should not see "There are validation errors on this page, please fix them before saving or publishing." | ||
And I should not see an invalid tab icon on the "Main" tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters