From 92a5a19a4bf030cd25f8a675fefc6f366ee69d05 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 6 Nov 2025 10:11:06 -0800 Subject: [PATCH 1/5] Handle tricky characters in domain name JavaScript test --- experiment/src/client/test/integration/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/experiment/src/client/test/integration/utils.ts b/experiment/src/client/test/integration/utils.ts index 29afefd71d8..9ca91ae63d5 100644 --- a/experiment/src/client/test/integration/utils.ts +++ b/experiment/src/client/test/integration/utils.ts @@ -463,7 +463,7 @@ async function verifyDomainCreateFailure(server: IntegrationTestServer, domainTy }, {...folderOptions, ...userOptions}); expect(badDomainNameResp['body']['success']).toBeFalsy(); - expect(badDomainNameResp['body']['exception']).toBe(error.replace('REPLACE', badDomainName)); + expect(badDomainNameResp['body']['exception']).toBe(error.replace('REPLACE', () => badDomainName)); } async function verifyDomainUpdateFailure(server: IntegrationTestServer, domainId: number, domainURI: string, dataTypeRowId/*needed for updating dataclass*/: number, badDomainName: string, error: string, folderOptions: RequestOptions, userOptions: RequestOptions, domainFields?: any[]) { @@ -488,7 +488,7 @@ async function verifyDomainUpdateFailure(server: IntegrationTestServer, domainId const badDomainNameResp = await server.post('property', 'saveDomain', updatedDomainPayload, {...folderOptions, ...userOptions}); expect(badDomainNameResp['body']['success']).toBeFalsy(); - expect(badDomainNameResp['body']['exception']).toBe(error.replace('REPLACE', badDomainName)); + expect(badDomainNameResp['body']['exception']).toBe(error.replace('REPLACE', () => badDomainName)); } async function verifyDomainCreateSuccess(server: IntegrationTestServer, domainType: string, domainName: string, folderOptions: RequestOptions, userOptions: RequestOptions) { @@ -519,7 +519,7 @@ export async function checkDomainName(server: IntegrationTestServer, domainType: 'with\0nullCharacter': `Invalid ${domainType} name 'REPLACE'. ${domainType} name must contain only valid unicode characters.`, 'with\tnewLines': `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain 'tab', 'new line', or 'return' characters.`, '.startWithDot': `Invalid ${domainType} name 'REPLACE'. ${domainType} name must start with a letter or a number.`, - ['c' + selectRandomN(ILLEGAL_DOMAIN_CHARSET.split(''), 2).join('')]: `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain any of these characters: ` + ILLEGAL_DOMAIN_CHARSET, + ['c' + selectRandomN(ILLEGAL_DOMAIN_CHARSET.split(''), 2).join('')]: `Invalid DataClass name 'REPLACE'. ${domainType} name may not contain any of these characters: ` + ILLEGAL_DOMAIN_CHARSET, 'a -b': `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain space followed by dash.` }; if (supportNameExpression) { From 2315c99c70793ab0c27ac3bf90a9ae5346335512 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 6 Nov 2025 10:12:22 -0800 Subject: [PATCH 2/5] Revert accidental change --- experiment/src/client/test/integration/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiment/src/client/test/integration/utils.ts b/experiment/src/client/test/integration/utils.ts index 9ca91ae63d5..19c9fcf82b5 100644 --- a/experiment/src/client/test/integration/utils.ts +++ b/experiment/src/client/test/integration/utils.ts @@ -519,7 +519,7 @@ export async function checkDomainName(server: IntegrationTestServer, domainType: 'with\0nullCharacter': `Invalid ${domainType} name 'REPLACE'. ${domainType} name must contain only valid unicode characters.`, 'with\tnewLines': `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain 'tab', 'new line', or 'return' characters.`, '.startWithDot': `Invalid ${domainType} name 'REPLACE'. ${domainType} name must start with a letter or a number.`, - ['c' + selectRandomN(ILLEGAL_DOMAIN_CHARSET.split(''), 2).join('')]: `Invalid DataClass name 'REPLACE'. ${domainType} name may not contain any of these characters: ` + ILLEGAL_DOMAIN_CHARSET, + ['c' + selectRandomN(ILLEGAL_DOMAIN_CHARSET.split(''), 2).join('')]: `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain any of these characters: ` + ILLEGAL_DOMAIN_CHARSET, 'a -b': `Invalid ${domainType} name 'REPLACE'. ${domainType} name may not contain space followed by dash.` }; if (supportNameExpression) { From df8a9fc4959497d75ef7c221ede13bf576cc20f7 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 6 Nov 2025 10:38:02 -0800 Subject: [PATCH 3/5] Handle Windows file path --- .../client/test/integration/AssayImportRunAction.ispec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts b/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts index 93f2fc05ec5..61ef1557a0f 100644 --- a/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts +++ b/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts @@ -221,9 +221,9 @@ describe('assay-importRun.api', () => { const run = await getRunQueryRow(server, ASSAY_A_NAME, runId, topFolderOptions); const expectedUrl = `/${encodeURIComponent(PROJECT_NAME)}/core-downloadFileLink.view?propertyId=`; const runBatchField = `Batch/${BATCH_FILE_FIELD_NAME}`; - expect(run[runBatchField].value).toEqual(`assaydata/${batchFileName}`); + expect(run[runBatchField].value.replace('\\', '/')).toEqual(`assaydata/${batchFileName}`); expect(run[runBatchField].url).toContain(expectedUrl); - expect(run[RUN_FILE_FIELD_NAME].value).toEqual(`assaydata/${runFileName}`); + expect(run[RUN_FILE_FIELD_NAME].value.replace('\\', '/')).toEqual(`assaydata/${runFileName}`); expect(run[RUN_FILE_FIELD_NAME].url).toContain(expectedUrl); // Verify audit log @@ -504,9 +504,9 @@ describe('assay-importRun.api', () => { const run = await getRunQueryRow(server, ASSAY_A_NAME, runId, topFolderOptions); const expectedUrl = `/${encodeURIComponent(PROJECT_NAME)}/core-downloadFileLink.view?propertyId=`; const runBatchField = `Batch/${BATCH_FILE_FIELD_TWO_NAME}`; - expect(run[runBatchField].value).toEqual(`assaydata/${batchFileName}`); + expect(run[runBatchField].value.replace('\\', '/')).toEqual(`assaydata/${batchFileName}`); expect(run[runBatchField].url).toContain(expectedUrl); - expect(run[RUN_FILE_FIELD_NAME].value).toEqual(`assaydata/${runFileName}`); + expect(run[RUN_FILE_FIELD_NAME].value.replace('\\', '/')).toEqual(`assaydata/${runFileName}`); expect(run[RUN_FILE_FIELD_NAME].url).toContain(expectedUrl); // Verify audit log From 00aa734b69f6c20dd50a022cefbdac9825cf09d5 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 6 Nov 2025 11:24:52 -0800 Subject: [PATCH 4/5] Verify domainId and domainURI are returned --- experiment/src/client/test/integration/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/experiment/src/client/test/integration/utils.ts b/experiment/src/client/test/integration/utils.ts index 19c9fcf82b5..fc49ebb52a8 100644 --- a/experiment/src/client/test/integration/utils.ts +++ b/experiment/src/client/test/integration/utils.ts @@ -502,6 +502,8 @@ async function verifyDomainCreateSuccess(server: IntegrationTestServer, domainTy } }, {...folderOptions, ...userOptions}).expect((result) => { const domain = JSON.parse(result.text); + expect(domain).toHaveProperty('domainId'); + expect(domain).toHaveProperty('domainURI'); domainId = domain.domainId; domainURI = domain.domainURI; return true; @@ -626,6 +628,8 @@ export async function verifyRequiredLineageInsertUpdate(server: IntegrationTestS } }, {...topFolderOptions, ...designerReaderOptions}).expect((result) => { const domain = JSON.parse(result.text); + expect(domain).toHaveProperty('domainId'); + expect(domain).toHaveProperty('domainURI'); childDomainId = domain.domainId; childDomainURI = domain.domainURI; return true; From c55a1f89e5c96dc6fa1a2d1cb8b1278946267ae1 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 6 Nov 2025 15:55:22 -0800 Subject: [PATCH 5/5] Make GitHub check happy --- .../client/test/integration/AssayImportRunAction.ispec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts b/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts index 61ef1557a0f..6cb47738cd0 100644 --- a/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts +++ b/experiment/src/client/test/integration/AssayImportRunAction.ispec.ts @@ -221,9 +221,9 @@ describe('assay-importRun.api', () => { const run = await getRunQueryRow(server, ASSAY_A_NAME, runId, topFolderOptions); const expectedUrl = `/${encodeURIComponent(PROJECT_NAME)}/core-downloadFileLink.view?propertyId=`; const runBatchField = `Batch/${BATCH_FILE_FIELD_NAME}`; - expect(run[runBatchField].value.replace('\\', '/')).toEqual(`assaydata/${batchFileName}`); + expect(run[runBatchField].value.replaceAll('\\', '/')).toEqual(`assaydata/${batchFileName}`); expect(run[runBatchField].url).toContain(expectedUrl); - expect(run[RUN_FILE_FIELD_NAME].value.replace('\\', '/')).toEqual(`assaydata/${runFileName}`); + expect(run[RUN_FILE_FIELD_NAME].value.replaceAll('\\', '/')).toEqual(`assaydata/${runFileName}`); expect(run[RUN_FILE_FIELD_NAME].url).toContain(expectedUrl); // Verify audit log @@ -504,9 +504,9 @@ describe('assay-importRun.api', () => { const run = await getRunQueryRow(server, ASSAY_A_NAME, runId, topFolderOptions); const expectedUrl = `/${encodeURIComponent(PROJECT_NAME)}/core-downloadFileLink.view?propertyId=`; const runBatchField = `Batch/${BATCH_FILE_FIELD_TWO_NAME}`; - expect(run[runBatchField].value.replace('\\', '/')).toEqual(`assaydata/${batchFileName}`); + expect(run[runBatchField].value.replaceAll('\\', '/')).toEqual(`assaydata/${batchFileName}`); expect(run[runBatchField].url).toContain(expectedUrl); - expect(run[RUN_FILE_FIELD_NAME].value.replace('\\', '/')).toEqual(`assaydata/${runFileName}`); + expect(run[RUN_FILE_FIELD_NAME].value.replaceAll('\\', '/')).toEqual(`assaydata/${runFileName}`); expect(run[RUN_FILE_FIELD_NAME].url).toContain(expectedUrl); // Verify audit log