Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 9
19.3 fb issue38940#159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
19.3 fb issue38940 #159
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9dcc251
Issue 38940: need automated test to verify field-level errors/warning…
labkey-chrisj 4c912c1
Issue 38940: cr feedback
labkey-chrisj 092c05c
Issue 38940: update test method name
labkey-chrisj 58a60fc
Merge branch 'release19.3-SNAPSHOT' into 19.3_fb_issue38940
labkey-chrisj ac3ae86
remove asserts that expect 'Save' button to be disabled when errors a…
labkey-chrisj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -43,7 +43,9 @@ | ||
| import java.util.Map; | ||
| import java.util.stream.Collectors; | ||
| import static org.hamcrest.CoreMatchers.containsString; | ||
| import static org.hamcrest.CoreMatchers.hasItems; | ||
| import static org.hamcrest.MatcherAssert.assertThat; | ||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertFalse; | ||
| import static org.junit.Assert.assertNotNull; | ||
| @@ -305,6 +307,12 @@ public void testBlankNameFieldOnAddedField() throws Exception | ||
| assertTrue("expect error to contain [Please provide a name for each field.] but was[" + hasNoNameError + "]", | ||
| hasNoNameError.contains("Please provide a name for each field.")); | ||
| String warningFieldMessage = noNameRow.setName("&has weird characters that make scripts hard to write") | ||
| .waitForWarning() | ||
| .detailsMessage(); | ||
| String expectedWarning = "New field. Warning: SQL queries, R scripts, and other code are easiest to write when field names only contain combination of letters, numbers, and underscores, and start with a letter or underscore"; | ||
| assertThat("expected error", warningFieldMessage, containsString(expectedWarning)); | ||
| domainDesignerPage.clickCancelAndDiscardChanges(); | ||
| } | ||
| @@ -470,7 +478,7 @@ public void testConfirmNameFieldFromSamplesetNotShown() throws Exception | ||
| } | ||
| @Test | ||
| public void testAddFieldsWithReservedNames() throws Exception | ||
| public void testFieldNameErrors() throws Exception | ||
| { | ||
| String sampleSet = "fieldsWithReservedNamesSampleSet"; | ||
| @@ -491,15 +499,19 @@ public void testAddFieldsWithReservedNames() throws Exception | ||
| DomainFieldRow clientFieldWarning = domainFormPanel.addField("select * from table"); | ||
labkey-chrisj marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| domainDesignerPage.clickFinishExpectingError(); | ||
| // TODO: Look for warning on row instead of banner. We're not doing warning banners anymore | ||
| // String clientWarning = domainDesignerPage.waitForWarning(); | ||
| // String multipleIssuesError = domainDesignerPage.waitForError(); | ||
| // String expectedErrMsg = "Multiple fields contain issues that need to be fixed. Review the red highlighted fields below for more information."; | ||
| // String expectedWarningMsg = " SQL queries, R scripts, and other code are easiest to write when field names only contain combination of letters, numbers, and underscores, and start with a letter or underscore."; | ||
| // assertTrue("expect error message to contain [" + expectedErrMsg + "] but was [" + multipleIssuesError + "]", | ||
| // multipleIssuesError.contains(expectedErrMsg)); | ||
| // assertTrue("expect warning message to contain [" + expectedWarningMsg + "] but was [" + clientWarning + "]", | ||
| // clientWarning.contains(expectedWarningMsg)); | ||
| String expectedWarnMsg = "New field. Warning: SQL queries, R scripts, and other code are easiest to write when field names only contain combination of letters, numbers, and underscores, and start with a letter or underscore."; | ||
| String blargErrMsg = "New field. Error: The field name 'blarg' is already taken. Please provide a unique name for each field."; | ||
| String reservedErrMsg = "New field. Error: 'modified' is a reserved field name in 'fieldsWithReservedNamesSampleSet'."; | ||
| String modRowDetailsMsg = modifiedRow.waitForError() | ||
| .detailsMessage(); | ||
| String blarg1DetailsMsg = blarg1.waitForError().detailsMessage(); | ||
| String blarg2DetailsMsg = blarg2.waitForError().detailsMessage(); | ||
| String clientFieldWarningMsg = clientFieldWarning.waitForWarning().detailsMessage(); | ||
| assertThat("expected warning", clientFieldWarningMsg, containsString(expectedWarnMsg)); | ||
| assertThat("expected error", blarg1DetailsMsg, containsString(blargErrMsg)); | ||
| assertThat("expected error", blarg2DetailsMsg, containsString(blargErrMsg)); | ||
| assertThat("expected error", modRowDetailsMsg, containsString(reservedErrMsg)); | ||
| assertTrue("expect field error when using reserved field names", modifiedRow.hasFieldError()); | ||
| assertTrue("expect error for duplicate field names", blarg1.hasFieldError()); | ||
labkey-chrisj marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.