Skip to content
Merged
Show file tree
Hide file tree
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
1,339 changes: 682 additions & 657 deletions assay/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"lint-fix": "eslint --fix"
},
"dependencies": {
"@labkey/components": "7.75.1"
"@labkey/components": "7.75.2"
},
"devDependencies": {
"@labkey/build": "10.1.4",
"@labkey/eslint-config": "1.2.5",
"@labkey/build": "10.1.5",
"@labkey/eslint-config": "1.2.6",
"@types/jest": "30.0.0",
"@types/react": "18.3.31",
"@types/react-dom": "18.3.7",
Expand Down
1,355 changes: 690 additions & 665 deletions core/package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"lint-branch-fix": "node lint.diff.mjs --currentBranch --fix"
},
"dependencies": {
"@labkey/components": "7.75.1",
"@labkey/themes": "1.9.8"
"@labkey/components": "7.75.2",
"@labkey/themes": "1.9.9"
},
"devDependencies": {
"@labkey/build": "10.1.4",
"@labkey/eslint-config": "1.2.5",
"@labkey/build": "10.1.5",
"@labkey/eslint-config": "1.2.6",
"@types/jest": "30.0.0",
"@types/react": "18.3.31",
"@types/react-dom": "18.3.7",
"execa": "10.2.0",
"execa": "10.2.1",
"fs-extra": "11.4.1",
"jest": "30.5.2",
"jest-cli": "30.5.2",
Expand Down
1,378 changes: 696 additions & 682 deletions experiment/package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions experiment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@
"test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js"
},
"dependencies": {
"@labkey/components": "7.75.1"
"@labkey/components": "7.75.2"
},
"devDependencies": {
"@labkey/build": "10.1.4",
"@labkey/eslint-config": "1.2.5",
"@labkey/test": "1.14.6",
"@labkey/build": "10.1.5",
"@labkey/eslint-config": "1.2.6",
"@labkey/test": "1.14.7",
"@types/jest": "30.0.0",
"@types/react": "18.3.31",
"@types/react-dom": "18.3.7",
"jest": "30.5.2",
"jest-cli": "30.5.2",
"jest-environment-jsdom": "30.5.2",
"jest-teamcity-reporter": "0.9.0",
"mock-fs": "5.5.0",
"ts-jest": "29.4.15"
},
"allowScripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
import { hookServer, IntegrationTestServer, RequestOptions, successfulResponse, testSeed } from '@labkey/test';
import mock from 'mock-fs';
import {
hookServer,
IntegrationTestServer,
mockFile,
mockFiles,
RequestOptions,
successfulResponse,
testSeed,
} from '@labkey/test';

import {
AssayDesignFieldOptions,
Expand Down Expand Up @@ -103,7 +110,7 @@ afterAll(async () => {
});

afterEach(() => {
mock.restore();
mockFiles.restore();
});

function fileNameWithIncrement(fileName: string, increment: number): string {
Expand Down Expand Up @@ -248,7 +255,7 @@ describe('assay-importRun.api', () => {
const runFilePath = `file://path/${runFileName}`;
const runFileName2 = 'runFileB.txt';
const runFilePath2 = `file://path/${runFileName2}`;
mock({
mockFiles({
[batchFilePath]: 'Batch McBatch',
[runFilePath]: 'Run McRun',
[batchFilePath2]: 'Run McBatch',
Expand Down Expand Up @@ -339,7 +346,7 @@ describe('assay-importRun.api', () => {

// Successfully import a run with file properties
{
mock({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
mockFiles({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
const payload: ImportRunOptions = {
assayId: ASSAY_A_ID,
batchProperties: { [BATCH_FILE_FIELD_NAME]: batchFilePath },
Expand All @@ -359,7 +366,7 @@ describe('assay-importRun.api', () => {
{
const riBatchFilePath = `file://path/reimport/batch/${sameFileName}`;
const riRunFilePath = `file://path/reimport/run/${sameFileName}`;
mock({
mockFiles({
[batchFilePath]: 'Batch McBatch',
[runFilePath]: 'Run McRun',
[riBatchFilePath]: 'Reimport Batch McBatch',
Expand Down Expand Up @@ -408,7 +415,7 @@ describe('assay-importRun.api', () => {

// Successfully import a run with file properties
{
mock({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
mockFiles({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
const payload: ImportRunOptions = {
assayId: ASSAY_A_ID,
batchProperties: {
Expand Down Expand Up @@ -439,7 +446,7 @@ describe('assay-importRun.api', () => {
const riBatchFilePath = `file://path/reimport/batch/${batchFileName}`;
const riRunFile2Name = 'reimportRunFileBBRI.txt';
const riRunFile2Path = `file://path/reimport/run/${riRunFile2Name}`;
mock({
mockFiles({
[riBatchFilePath]: 'Reimport Batch McBatch',
[riRunFile2Path]: 'Reimport Run McRun 2',
[runFilePath]: 'Run McRun',
Expand Down Expand Up @@ -515,7 +522,7 @@ describe('assay-importRun.api', () => {
const batchFilePath = `file://path/${batchFileName}`;
const runFileName = 'uploadRunFileA.txt';
const runFilePath = `file://path/${runFileName}`;
mock({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
mockFiles({ [batchFilePath]: 'Batch McBatch', [runFilePath]: 'Run McRun' });
const { editorUserOptions, topFolderOptions } = context;

let batchFile;
Expand All @@ -527,7 +534,11 @@ describe('assay-importRun.api', () => {
.request(
'assay',
'assayFileUpload.api',
(agent, url) => agent.post(url).attach('file', batchFilePath).attach('file1', runFilePath),
(agent, url) =>
agent
.post(url)
.attach('file', ...mockFile(batchFilePath))
.attach('file1', ...mockFile(runFilePath)),
options(topFolderOptions, editorUserOptions)
)
.expect(successfulResponse);
Expand Down
5 changes: 0 additions & 5 deletions experiment/src/client/test/integration/DataClassCrud.ispec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
successfulResponse,
testSeed
} from '@labkey/test';
import mock from 'mock-fs';
import {
checkDomainName,
checkDomainNameConflicts,
Expand Down Expand Up @@ -84,10 +83,6 @@ afterAll(async () => {
return server.teardown();
});

afterEach(() => {
mock.restore();
});


// TODO: move utils to ExperimentCRUDUtils
export async function insertDataClassData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
import mock from 'mock-fs';
import { PermissionRoles } from '@labkey/api';
import { hookServer, RequestOptions } from '@labkey/test';
import { hookServer, mockFiles, RequestOptions } from '@labkey/test';
import {
AssayDesignFieldOptions,
createAssayDesign,
Expand Down Expand Up @@ -93,7 +92,7 @@ afterAll(async () => {
});

afterEach(() => {
mock.restore();
mockFiles.restore();
});

describe('Move Assay Runs', () => {
Expand Down Expand Up @@ -479,7 +478,7 @@ describe('Move Assay Runs', () => {
it('success, move run with run file field', async () => {
// Arrange
const { runId } = await importRun(server, assayWithRunFileId, 'top-movetosub1-8', [{"Prop":"ABC"}], topFolderOptions, editorUserOptions);
mock({
mockFiles({
'runFileA.txt': 'fileA contents',
});
await uploadAssayFile(server, 'assayWithRunFile', runId, true, 'RunFileField', 'runFileA.txt', topFolderOptions, editorUserOptions)
Expand Down Expand Up @@ -523,7 +522,7 @@ describe('Move Assay Runs', () => {
const { runId } = await importRun(server, assayWithResultFileId, 'top-movetosub1-9', [{"Prop":"ABC"}], topFolderOptions, editorUserOptions);
const assayResults = await getAssayResults(server, 'assayWithResultFile', 'ResultFileField', runId, topFolderOptions);
const resultRowId = caseInsensitive(assayResults[0], 'rowid');
mock({
mockFiles({
'resultFileA.txt': 'fileA contents',
});
await uploadAssayFile(server, 'assayWithResultFile', resultRowId, false, 'ResultFileField', 'resultFileA.txt', topFolderOptions, editorUserOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
import mock from 'mock-fs';
import { PermissionRoles } from '@labkey/api';
import { hookServer, RequestOptions, successfulResponse } from '@labkey/test';
import { hookServer, mockFile, mockFiles, RequestOptions, successfulResponse } from '@labkey/test';
import { caseInsensitive } from '@labkey/components';
import {
createDerivedObjects,
Expand Down Expand Up @@ -94,7 +93,7 @@ afterAll(async () => {
});

afterEach(() => {
mock.restore();
mockFiles.restore();
});

async function createDerivedSamples(sampleNames: string[], sampleTypeName: string, folderOptions: RequestOptions, parentSampleType: string, parentSamples: string[], sourceParents?: string[], auditBehavior?: string, ) {
Expand Down Expand Up @@ -144,7 +143,7 @@ async function createSampleWithFileFields(sampleName: string, folderOptions: Req
}));

Object.keys(fileData).forEach(fieldName => {
request = request.attach(fieldName + "::0", fileData[fieldName]);
request = request.attach(fieldName + "::0", ...mockFile(fileData[fieldName]));
});

return request;
Expand Down Expand Up @@ -701,7 +700,7 @@ describe('Move Samples', () => {
});

it('success, move one sample from parent with file field', async () => {
mock({
mockFiles({
'fileA.txt': 'fileA contents',
});
const sampleRowId1 = await createSampleWithFileFields('top2-movetosub1-1', topFolderOptions, {[FILE_FIELD_1_NAME]: 'fileA.txt'}, "DETAILED");
Expand Down Expand Up @@ -732,7 +731,7 @@ describe('Move Samples', () => {
});

it('success, move sample from subfolder with multiple file fields', async () => {
mock({
mockFiles({
'fileB.txt': 'fileB contents',
'fileC.txt': 'fileC contents',
});
Expand Down Expand Up @@ -768,7 +767,7 @@ describe('Move Samples', () => {
});

it('success, move sample from subfolder with overlapping file name', async () => {
mock({
mockFiles({
'fileD.txt': 'fileD contents',
'fileE.txt': 'fileE contents',
});
Expand Down Expand Up @@ -806,7 +805,7 @@ describe('Move Samples', () => {
});

it('success, move to sibling subfolder without files', async () => {
mock({
mockFiles({
'fileF.txt': 'fileF contents',
});
const sampleRowId1 = await createSampleWithFileFields('sub12-movetosub2-1', subfolder1Options, {[FILE_FIELD_1_NAME]: 'fileF.txt'}, "DETAILED");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
import mock from 'mock-fs';
import { PermissionRoles } from '@labkey/api';
import { hookServer, RequestOptions, successfulResponse } from '@labkey/test';
import { hookServer, mockFile, mockFiles, RequestOptions, successfulResponse } from '@labkey/test';
import { caseInsensitive } from '@labkey/components';
import {
ATTACHMENT_FIELD_1_NAME,
Expand Down Expand Up @@ -96,7 +95,7 @@ afterAll(async () => {
});

afterEach(() => {
mock.restore();
mockFiles.restore();
});

async function createDerivedSources(names: string[], sourceTypeName: string, folderOptions: RequestOptions, parentSourceType: string, parentSources: string[], parentSampleType?: string, sampleParents?: string[], auditBehavior?: string, ) {
Expand All @@ -115,7 +114,7 @@ async function createSourceWithAttachments(sourceName: string, folderOptions: Re
}));

Object.keys(fileData).forEach(fieldName => {
request = request.attach(fieldName + "::0", fileData[fieldName]);
request = request.attach(fieldName + "::0", ...mockFile(fileData[fieldName]));
});

return request;
Expand Down Expand Up @@ -692,7 +691,7 @@ describe('Move Sources', () => {
});

it('success, move one from parent with attachment field', async () => {
mock({
mockFiles({
'fileA.txt': 'fileA contents',
});
const sourceRowId1 = await createSourceWithAttachments('top2-movetosub1-1', topFolderOptions, {[ATTACHMENT_FIELD_1_NAME]: 'fileA.txt'}, "DETAILED");
Expand Down Expand Up @@ -720,7 +719,7 @@ describe('Move Sources', () => {
});

it('success, move from subfolder with multiple attachment fields', async () => {
mock({
mockFiles({
'fileB.txt': 'fileB contents',
'fileC.txt': 'fileC contents',
});
Expand Down
Loading