Unverified Commit d1a44c9a authored by Manoj Pandian Sakthivel's avatar Manoj Pandian Sakthivel Committed by GitHub
Browse files

Fix types (#454)

parent 7ec4831b
Pipeline #132723 passed with stages
in 8 minutes and 38 seconds
......@@ -41,8 +41,7 @@ describe('<TrackPanelList />', () => {
activeEnsObject: createEnsObject(),
selectedTrackPanelTab: TrackSet.GENOMIC,
genomeTrackCategories: createGenomeCategories(),
trackStates: createTrackStates(),
toggleDrawer: jest.fn()
trackStates: createTrackStates()
};
const mountTrackPanelList = (props?: Partial<TrackPanelListProps>) =>
......
......@@ -88,7 +88,7 @@ const wrapInRedux = (
return mount(
<Provider store={store}>
<TranscriptsFilter
filterLabel={filterLabel}
label={filterLabel}
transcripts={transcripts}
toggleFilter={mockToggleFilter}
/>
......
......@@ -20,7 +20,7 @@ import {
EnsObject,
EnsObjectType
} from 'src/shared/state/ens-object/ensObjectTypes';
import { Strand } from 'src/content/app/entity-viewer/types/strand';
import { Strand } from 'src/shared/types/thoas/strand';
export const createEnsObject = (objectType?: EnsObjectType): EnsObject => {
const genome_id = faker.lorem.word();
......@@ -57,5 +57,6 @@ const createTrackInfo = () => ({
object_id: faker.lorem.word(),
support_level: null,
track_id: faker.lorem.word(),
description: null
description: null,
stable_id: faker.lorem.words()
});
......@@ -21,7 +21,7 @@ import { scaleLinear } from 'd3';
import { createSlice } from './slice';
import { createTranscript } from './transcript';
import { Gene } from 'src/content/app/entity-viewer/types/gene';
import { Gene } from 'src/shared/types/thoas/gene';
import { TicksAndScale } from 'src/content/app/entity-viewer/gene-view/components/base-pairs-ruler/BasePairsRuler';
export const createGene = (fragment: Partial<Gene> = {}): Gene => {
......
......@@ -21,7 +21,7 @@ import {
ProteinDomain,
Product,
ProductType
} from 'src/content/app/entity-viewer/types/product';
} from 'src/shared/types/thoas/product';
export const createProduct = (fragment: Partial<Product> = {}): Product => {
const length = fragment?.length || faker.random.number({ min: 10, max: 100 });
......
......@@ -16,8 +16,8 @@
import faker from 'faker';
import { Slice } from 'src/content/app/entity-viewer/types/slice';
import { Strand } from 'src/content/app/entity-viewer/types/strand';
import { Slice } from 'src/shared/types/thoas/slice';
import { Strand } from 'src/shared/types/thoas/strand';
export const createSlice = (): Slice => {
const start = faker.random.number({ min: 1, max: 1000000 });
......
......@@ -21,17 +21,14 @@ import { createSlice } from './slice';
import { createProduct } from './product';
import { getFeatureCoordinates } from 'src/content/app/entity-viewer/shared/helpers/entity-helpers';
import { Transcript } from 'src/content/app/entity-viewer/types/transcript';
import {
Exon,
SplicedExon,
PhasedExon
} from 'src/content/app/entity-viewer/types/exon';
import { Slice } from 'src/content/app/entity-viewer/types/slice';
import { CDS } from 'src/content/app/entity-viewer/types/cds';
import { CDNA } from 'src/content/app/entity-viewer/types/cdna';
import { ProductGeneratingContext } from 'src/content/app/entity-viewer/types/productGeneratingContext';
import { ProductType } from 'src/content/app/entity-viewer/types/product';
import { Transcript } from 'src/shared/types/thoas/transcript';
import { Exon, SplicedExon, PhasedExon } from 'src/shared/types/thoas/exon';
import { Slice } from 'src/shared/types/thoas/slice';
import { CDS } from 'src/shared/types/thoas/cds';
import { CDNA } from 'src/shared/types/thoas/cdna';
import { ProductGeneratingContext } from 'src/shared/types/thoas/productGeneratingContext';
import { ProductType } from 'src/shared/types/thoas/product';
import { ExternalReference } from 'src/shared/types/thoas/externalReference';
export const createTranscript = (
fragment: Partial<Transcript> = {}
......@@ -51,6 +48,7 @@ export const createTranscript = (
symbol: faker.lorem.word(),
so_term: faker.lorem.word(),
slice: transcriptSlice,
external_references: createExternalReferences(),
relative_location: {
start: 1,
end: transcriptSlice.location.end,
......@@ -64,6 +62,24 @@ export const createTranscript = (
};
};
const createExternalReferences = (): ExternalReference[] => {
const numberOfExternalReferences = faker.random.number({ min: 1, max: 10 });
return times(numberOfExternalReferences, () => {
return {
accession_id: faker.random.uuid(),
name: faker.random.words(),
description: faker.random.words(),
url: faker.internet.url(),
source: {
name: faker.random.words(),
id: faker.random.uuid(),
url: faker.internet.url()
}
};
});
};
const createSplicedExons = (
transcriptSlice: Slice,
exons: Exon[]
......
/**
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import faker from 'faker';
import times from 'lodash/times';
......@@ -21,7 +37,8 @@ export const createGenomeCategories = (): GenomeTrackCategory[] => [
{
description: faker.lorem.words(),
label: faker.lorem.words(),
track_id: faker.lorem.words()
track_id: faker.lorem.words(),
stable_id: faker.lorem.words()
}
],
types: [TrackSet.VARIATION]
......
/**
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import faker from 'faker';
import { Status } from 'src/shared/types/status';
......@@ -17,7 +33,8 @@ export const createTrackInfo = (): EnsObjectTrack => ({
additional_info: faker.lorem.words(),
description: faker.lorem.words(),
label: faker.lorem.words(),
track_id: 'gene-pc-fwd'
track_id: 'gene-pc-fwd',
stable_id: faker.lorem.words()
});
export const createMainTrackInfo = (): EnsObjectTrack => ({
......@@ -29,11 +46,13 @@ export const createMainTrackInfo = (): EnsObjectTrack => ({
description: faker.lorem.words(),
label: faker.lorem.words(),
support_level: faker.lorem.words(),
track_id: 'gene-feat-1'
track_id: 'gene-feat-1',
stable_id: faker.lorem.words()
}
],
description: faker.lorem.words(),
ensembl_object_id: faker.lorem.words(),
label: faker.lorem.words(),
track_id: 'gene-feat'
track_id: 'gene-feat',
stable_id: faker.lorem.words()
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment