Skip to content

Commit

Permalink
(edit) remove the filter actions from the resources (not required) an…
Browse files Browse the repository at this point in the history
…d update their corresponding test
  • Loading branch information
nozomione committed Aug 24, 2023
1 parent 9a10b87 commit 02cc53f
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 75 deletions.
10 changes: 3 additions & 7 deletions src/resources/compendia/compendia.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/compendia/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 3 additions & 7 deletions src/resources/experiments/experiments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/experiments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/resources/institutions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/institutions/institutions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
5 changes: 2 additions & 3 deletions src/resources/organisms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 3 additions & 7 deletions src/resources/organisms/organisms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/originalFiles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/resources/originalFiles/originalFiles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/resources/platforms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/platforms/platforms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
5 changes: 2 additions & 3 deletions src/resources/processors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/resources/processors/processors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/qnTargets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/resources/qnTargets/qnTargets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/samples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/resources/samples/samples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/resources/transcriptomeIndices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 02cc53f

Please sign in to comment.