Skip to content

Commit d0af8ad

Browse files
Issue 53313: Fields with non alpha/numeric chars not shown in Custom Properties
1 parent 25a9395 commit d0af8ad

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

src/org/labkey/test/tests/SampleTypeTest.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
import static org.junit.Assert.assertNotEquals;
8080
import static org.junit.Assert.assertNotNull;
8181
import static org.junit.Assert.assertTrue;
82+
import static org.labkey.test.params.FieldDefinition.DOMAIN_TRICKY_CHARACTERS;
8283
import static org.labkey.test.util.DataRegionTable.DataRegion;
8384

8485
@Category({Daily.class})
@@ -241,7 +242,36 @@ public void testCreateSampleTypeNoExpression()
241242
sampleTypeHelper.verifyDataValues(data);
242243
}
243244

244-
// Issue 47280: LKSM: Trailing/Leading whitespace in Source name won't resolve when deriving samples
245+
// Issue 53313: LKS doesn't show Sample Type fields with special characters in Custom Properties
246+
@Test
247+
public void testCustomProperties()
248+
{
249+
final String sampleTypeName = "SampleTypeCustomProps" + DOMAIN_TRICKY_CHARACTERS;
250+
final List<FieldDefinition> fields = List.of(
251+
new FieldDefinition("StringColPlain", FieldDefinition.ColumnType.String),
252+
new FieldDefinition("StringCol%", FieldDefinition.ColumnType.String),
253+
new FieldDefinition("CalcCol", ColumnType.Calculation).setValueExpression("StringColPlain || 'Concat'"));
254+
255+
SampleTypeDefinition sampleTypeDefinition = new SampleTypeDefinition(sampleTypeName).setFields(fields);
256+
257+
SampleTypeAPIHelper.createEmptySampleType(getProjectName(), sampleTypeDefinition);
258+
259+
log("Create a new sample type");
260+
projectMenu().navigateToFolder(PROJECT_NAME, FOLDER_NAME);
261+
SampleTypeHelper sampleTypeHelper = new SampleTypeHelper(this);
262+
sampleTypeHelper.goToSampleType(sampleTypeName);
263+
264+
log("Add a single row to the sample type, with trailing spaces");
265+
Map<String, String> fieldMap = Map.of("Name", "CustomPropsSample", "StringColPlain", "PlainValue", "StringCol%", "PercentValue");
266+
sampleTypeHelper.insertRow(fieldMap);
267+
268+
log("Verify custom properties, both name and values, are shown in both the grid and detail pages");
269+
assertTextPresent("String Col Plain", "String Col%", "Calc Col", "PlainValue", "PercentValue", "PlainValueConcat");
270+
clickAndWait(Locator.linkWithText("CustomPropsSample"));
271+
assertTextPresent("String Col Plain", "String Col%", "Calc Col", "PlainValue", "PercentValue", "PlainValueConcat");
272+
}
273+
274+
// Issue 47280: LKSM: Trailing/Leading whitespace in Source name won't resolve when deriving samples
245275
@Test
246276
public void testImportSamplesWithTrailingSpace()
247277
{

0 commit comments

Comments
 (0)