|
79 | 79 | import static org.junit.Assert.assertNotEquals; |
80 | 80 | import static org.junit.Assert.assertNotNull; |
81 | 81 | import static org.junit.Assert.assertTrue; |
| 82 | +import static org.labkey.test.params.FieldDefinition.DOMAIN_TRICKY_CHARACTERS; |
82 | 83 | import static org.labkey.test.util.DataRegionTable.DataRegion; |
83 | 84 |
|
84 | 85 | @Category({Daily.class}) |
@@ -241,7 +242,36 @@ public void testCreateSampleTypeNoExpression() |
241 | 242 | sampleTypeHelper.verifyDataValues(data); |
242 | 243 | } |
243 | 244 |
|
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 |
245 | 275 | @Test |
246 | 276 | public void testImportSamplesWithTrailingSpace() |
247 | 277 | { |
|
0 commit comments