Skip to content
Merged
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
24 changes: 14 additions & 10 deletions src/org/labkey/test/tests/list/ListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2110,29 +2110,33 @@ public void customizeURLTest()
}

/**
* Issue 53361: 'list-details.view' doesn't work when list pk is named "name"
* Expect bad product behavior. Convert this to a regression test once the issue is fixed.
* Regression for issue 53361: 'list-details.view' doesn't work when list pk is named "name"
* Test for both name and listId key field names.
*/
@Test
public void testPkNameParameterCollision() throws IOException, CommandException
{
String listName = TestDataGenerator.randomDomainName("list_key_check", DomainUtils.DomainKind.IntList);
String pkCol = "Name";
// Create lists with PKs having the same name as detail URL list definition identifier
// params to ensure we can resolve detail pages correctly
validateDetailsView("list_name_key_check", "Name");
validateDetailsView("list_id_key_check", "ListId");
}

private void validateDetailsView(String listName, String pkCol) throws CommandException, IOException
{
listName = TestDataGenerator.randomDomainName(listName, DomainUtils.DomainKind.IntList);
var dgen = new VarListDefinition(listName)
.setFields(List.of(new FieldDefinition(pkCol)))
.create(createDefaultConnection(), getProjectName())
.withGeneratedRows(10);
.setFields(List.of(new FieldDefinition(pkCol)))
.create(createDefaultConnection(), getProjectName())
.withGeneratedRows(10);
List<String> pks = dgen.getRows().stream().map(row -> (String) row.get(pkCol)).toList();
dgen.insertRows();

goToProjectHome();

goToManageLists().getGrid().viewListData(listName);

clickAndWait(Locator.linkWithText(pks.get(0)));
assertElementPresent(Locator.byClass("labkey-error-heading")
.withText("List item '%s' does not exist".formatted(listName)));
assertElementPresent(Locator.tagContainingText("td", pks.get(0)));
}

@Override
Expand Down