From 02cc53f3ddd28d7de6041a3e29e904b69df605b6 Mon Sep 17 00:00:00 2001 From: Nozomi Ichihara <31800566+nozomione@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:57:26 -0400 Subject: [PATCH] (edit) remove the filter actions from the resources (not required) and update their corresponding test --- src/resources/compendia/compendia.test.js | 10 +++------- src/resources/compendia/index.js | 5 ++--- src/resources/experiments/experiments.test.js | 10 +++------- src/resources/experiments/index.js | 5 ++--- src/resources/institutions/index.js | 4 ++-- src/resources/institutions/institutions.test.js | 2 +- src/resources/organisms/index.js | 5 ++--- src/resources/organisms/organisms.test.js | 10 +++------- src/resources/originalFiles/index.js | 5 ++--- src/resources/originalFiles/originalFiles.test.js | 10 +++++----- src/resources/platforms/index.js | 4 ++-- src/resources/platforms/platforms.test.js | 2 +- src/resources/processors/index.js | 5 ++--- src/resources/processors/processors.test.js | 10 +++++----- src/resources/qnTargets/index.js | 5 ++--- src/resources/qnTargets/qnTargets.test.js | 10 +++++----- src/resources/samples/index.js | 5 ++--- src/resources/samples/samples.test.js | 10 +++++----- src/resources/transcriptomeIndices/index.js | 5 ++--- .../transcriptomeIndices/transcriptomeIndices.test.js | 8 ++++---- 20 files changed, 55 insertions(+), 75 deletions(-) diff --git a/src/resources/compendia/compendia.test.js b/src/resources/compendia/compendia.test.js index 4063979..17e82d2 100644 --- a/src/resources/compendia/compendia.test.js +++ b/src/resources/compendia/compendia.test.js @@ -2,18 +2,14 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.compendia.filter() -}) - -test('get all compendia results with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() + getRequest = await api.compendia.get() }) test('get a compendium result by ID', async () => { - const { id } = filterRequest.response.results[0] + const { id } = getRequest.response.results[0] const getCompendia = await api.compendia.get(id) expect(getCompendia.isOk).toBeTruthy() diff --git a/src/resources/compendia/index.js b/src/resources/compendia/index.js index 9461c18..e29299a 100644 --- a/src/resources/compendia/index.js +++ b/src/resources/compendia/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const compendia = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'compendia') + const { get } = getActions(config, 'compendia') return { ...availableActions('compendia'), - get, - filter + get } } diff --git a/src/resources/experiments/experiments.test.js b/src/resources/experiments/experiments.test.js index afda42d..42b44a6 100644 --- a/src/resources/experiments/experiments.test.js +++ b/src/resources/experiments/experiments.test.js @@ -2,18 +2,14 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.experiments.filter() -}) - -test('get detailed information on experiments with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() + getRequest = await api.experiments.get() }) test('get an experiment by accession code', async () => { - const { accession_code: accessionCode } = filterRequest.response.results[0] + const { accession_code: accessionCode } = getRequest.response.results[0] const getExperiment = await api.experiments.get(accessionCode) expect(getExperiment.isOk).toBeTruthy() diff --git a/src/resources/experiments/index.js b/src/resources/experiments/index.js index 253e64f..cc9f04b 100644 --- a/src/resources/experiments/index.js +++ b/src/resources/experiments/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const experiments = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'experiments', 'accession_code') + const { get } = getActions(config, 'experiments', 'accession_code') return { ...availableActions('experiments'), - get, - filter + get } } diff --git a/src/resources/institutions/index.js b/src/resources/institutions/index.js index f2f7ca6..9982882 100644 --- a/src/resources/institutions/index.js +++ b/src/resources/institutions/index.js @@ -3,11 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const institutions = (config = defaultConfig) => { - const { filter } = getActions(config, 'institutions') + const { get } = getActions(config, 'institutions') return { ...availableActions('institutions'), - filter + get } } diff --git a/src/resources/institutions/institutions.test.js b/src/resources/institutions/institutions.test.js index 4bfd769..1737d17 100644 --- a/src/resources/institutions/institutions.test.js +++ b/src/resources/institutions/institutions.test.js @@ -3,7 +3,7 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) test('get all the available "institution" information', async () => { - const getInstitutions = await api.institutions.filter() + const getInstitutions = await api.institutions.get() expect(getInstitutions.isOk).toBeTruthy() }) diff --git a/src/resources/organisms/index.js b/src/resources/organisms/index.js index 26adbcc..cc87566 100644 --- a/src/resources/organisms/index.js +++ b/src/resources/organisms/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const organisms = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'organisms', 'name') + const { get } = getActions(config, 'organisms', 'name') return { ...availableActions('organisms'), - get, - filter + get } } diff --git a/src/resources/organisms/organisms.test.js b/src/resources/organisms/organisms.test.js index 7cdd519..0e9a6c7 100644 --- a/src/resources/organisms/organisms.test.js +++ b/src/resources/organisms/organisms.test.js @@ -2,18 +2,14 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.organisms.filter() -}) - -test('get all available organisms with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() + getRequest = await api.organisms.get() }) test('get an organism by its name', async () => { - const { name } = filterRequest.response.results[0] + const { name } = getRequest.response.results[0] const getOrganism = await api.organisms.get(name) expect(getOrganism.isOk).toBeTruthy() diff --git a/src/resources/originalFiles/index.js b/src/resources/originalFiles/index.js index 54f3f95..46b0ff9 100644 --- a/src/resources/originalFiles/index.js +++ b/src/resources/originalFiles/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const originalFiles = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'original_files') + const { get } = getActions(config, 'original_files') return { ...availableActions('original_files'), - get, - filter + get } } diff --git a/src/resources/originalFiles/originalFiles.test.js b/src/resources/originalFiles/originalFiles.test.js index 9b69cdb..ff945d7 100644 --- a/src/resources/originalFiles/originalFiles.test.js +++ b/src/resources/originalFiles/originalFiles.test.js @@ -2,18 +2,18 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.originalFiles.filter() + getRequest = await api.originalFiles.get() }) -test('get original files with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() +test('get original files', async () => { + expect(getRequest.isOk).toBeTruthy() }) test('get an original file by ID', async () => { - const { id } = filterRequest.response.results[0] + const { id } = getRequest.response.results[0] const getOriginalFile = await api.originalFiles.get(id) expect(getOriginalFile.isOk).toBeTruthy() diff --git a/src/resources/platforms/index.js b/src/resources/platforms/index.js index b38727a..b25070e 100644 --- a/src/resources/platforms/index.js +++ b/src/resources/platforms/index.js @@ -3,11 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const platforms = (config = defaultConfig) => { - const { filter } = getActions(config, 'platforms') + const { get } = getActions(config, 'platforms') return { ...availableActions('platforms'), - filter + get } } diff --git a/src/resources/platforms/platforms.test.js b/src/resources/platforms/platforms.test.js index ef998eb..8d71386 100644 --- a/src/resources/platforms/platforms.test.js +++ b/src/resources/platforms/platforms.test.js @@ -3,7 +3,7 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) test('get all the available "platforms" information', async () => { - const getPlatforms = await api.platforms.filter() + const getPlatforms = await api.platforms.get() expect(getPlatforms.isOk).toBeTruthy() }) diff --git a/src/resources/processors/index.js b/src/resources/processors/index.js index ad1f85c..e75e940 100644 --- a/src/resources/processors/index.js +++ b/src/resources/processors/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const processors = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'processors') + const { get } = getActions(config, 'processors') return { ...availableActions('processors'), - get, - filter + get } } diff --git a/src/resources/processors/processors.test.js b/src/resources/processors/processors.test.js index 9889598..d567451 100644 --- a/src/resources/processors/processors.test.js +++ b/src/resources/processors/processors.test.js @@ -2,18 +2,18 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.processors.filter() + getRequest = await api.processors.get() }) -test('get all available processors with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() +test('get all available processors', async () => { + expect(getRequest.isOk).toBeTruthy() }) test('get a processor by its ID', async () => { - const { id } = filterRequest.response.results[0] + const { id } = getRequest.response.results[0] const getProcessor = await api.processors.get(id) expect(getProcessor.isOk).toBeTruthy() diff --git a/src/resources/qnTargets/index.js b/src/resources/qnTargets/index.js index da12435..6f0655d 100644 --- a/src/resources/qnTargets/index.js +++ b/src/resources/qnTargets/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const qnTargets = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'qn_targets', 'organism_name') + const { get } = getActions(config, 'qn_targets', 'organism_name') return { ...availableActions('qn_targets'), - get, - filter + get } } diff --git a/src/resources/qnTargets/qnTargets.test.js b/src/resources/qnTargets/qnTargets.test.js index c183e83..4348ad0 100644 --- a/src/resources/qnTargets/qnTargets.test.js +++ b/src/resources/qnTargets/qnTargets.test.js @@ -2,18 +2,18 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.qnTargets.filter() + getRequest = await api.qnTargets.get() }) -test('get all organisms with available QN Targets with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() +test('get all organisms with available QN Targets', async () => { + expect(getRequest.isOk).toBeTruthy() }) test('get a Quantile Normalization file for an organism', async () => { - const { name } = filterRequest.response[0] + const { name } = getRequest.response[0] const getQnTarget = await api.qnTargets.get(name) expect(getQnTarget.isOk).toBeTruthy() diff --git a/src/resources/samples/index.js b/src/resources/samples/index.js index 30aa2d1..9f9083e 100644 --- a/src/resources/samples/index.js +++ b/src/resources/samples/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const samples = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'samples', 'accession_code') + const { get } = getActions(config, 'samples', 'accession_code') return { ...availableActions('samples'), - get, - filter + get } } diff --git a/src/resources/samples/samples.test.js b/src/resources/samples/samples.test.js index da28f40..be31810 100644 --- a/src/resources/samples/samples.test.js +++ b/src/resources/samples/samples.test.js @@ -2,18 +2,18 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.samples.filter() + getRequest = await api.samples.get() }) -test('get detailed information on samples with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() +test('get detailed information on samples', async () => { + expect(getRequest.isOk).toBeTruthy() }) test('get sample details by its accession code', async () => { - const { accession_code: accessionCode } = filterRequest.response.results[0] + const { accession_code: accessionCode } = getRequest.response.results[0] const getSample = await api.samples.get(accessionCode) expect(getSample.isOk).toBeTruthy() diff --git a/src/resources/transcriptomeIndices/index.js b/src/resources/transcriptomeIndices/index.js index 42cbe87..4e39c29 100644 --- a/src/resources/transcriptomeIndices/index.js +++ b/src/resources/transcriptomeIndices/index.js @@ -3,12 +3,11 @@ import { getActions } from 'utils/getActions' import { availableActions } from 'utils/availableActions' export const transcriptomeIndices = (config = defaultConfig) => { - const { get, filter } = getActions(config, 'transcriptome_indices') + const { get } = getActions(config, 'transcriptome_indices') return { ...availableActions('transcriptome_indices'), - get, - filter + get } } diff --git a/src/resources/transcriptomeIndices/transcriptomeIndices.test.js b/src/resources/transcriptomeIndices/transcriptomeIndices.test.js index 3c51ed6..c42d852 100644 --- a/src/resources/transcriptomeIndices/transcriptomeIndices.test.js +++ b/src/resources/transcriptomeIndices/transcriptomeIndices.test.js @@ -2,18 +2,18 @@ import Refinebio from 'index' const api = Refinebio({ verbose: true }) -let filterRequest +let getRequest beforeAll(async () => { - filterRequest = await api.transcriptomeIndices.filter() + getRequest = await api.transcriptomeIndices.get() }) test('get all transcriptome Indices with filtering', async () => { - expect(filterRequest.isOk).toBeTruthy() + expect(getRequest.isOk).toBeTruthy() }) test('get a S3 url associated with the transcriptome index', async () => { - const { id } = filterRequest.response.results[0] + const { id } = getRequest.response.results[0] const getS3Url = await api.transcriptomeIndices.get(id) expect(getS3Url.isOk).toBeTruthy()