Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/org/labkey/test/tests/SampleTypeParentColumnTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,6 @@ public void testAliasNameConflictsWithFieldName()
goToProjectHome();
projectMenu().navigateToFolder(PROJECT_NAME, SUB_FOLDER_NAME);

String path = PROJECT_NAME + "/" + SUB_FOLDER_NAME;

List<FieldDefinition> fields = new ArrayList<>();

fields.add(new FieldDefinition(ALIAS_NAME_CONFLICT, FieldDefinition.ColumnType.String));
Expand All @@ -726,7 +724,7 @@ public void testAliasNameConflictsWithFieldName()
String.join("\n", errors));
updatePage.removeParentAlias(0);

log("Now add a valid parent column and check that you cannot now add a field in the sample type with the same name.");
log("Now add a valid parent column and check that you cannot add a field in the sample type with the same name.");
updatePage.addParentAlias(GOOD_PARENT_NAME, SampleTypeDesigner.CURRENT_SAMPLE_TYPE);
updatePage.clickSave();

Expand All @@ -751,7 +749,17 @@ public void testAliasNameConflictsWithFieldName()

updatePage.clickCancel();

log("Validated name conflicts.");
// GH Issue 1257
clickFolder(SUB_FOLDER_NAME);
log("Check that you cannot add a field with an import alias that conflicts with the parent import alias");
updatePage = sampleHelper.goToEditSampleType(SAMPLE_TYPE_NAME);
updatePage.getFieldsPanel().addField("DupeAliasCheck")
.setImportAliases(GOOD_PARENT_NAME);
errors = updatePage.clickSaveExpectingErrors();
errorMsgExpectedTxt = "Field DupeAliasCheck has an import alias " + GOOD_PARENT_NAME + " that conflicts with a parent alias header.";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason we need to add some checks for the other cases here like having multiple fields that have the same import alias or having an import alias that matches a parent alias? Or maybe some of that could be covered with junit tests (not sure what our validation coverage looks like there for domains).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include that here because this test class is specifically for SampleTypeParentColumnTest. So, tests aren't completely done for this branch.

assertThat("Error message", String.join("\n", errors), CoreMatchers.containsString(errorMsgExpectedTxt));

updatePage.clickCancel();
}

@Test
Expand Down