-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathGeneFlags.spec.tsx
More file actions
40 lines (27 loc) · 1.16 KB
/
GeneFlags.spec.tsx
File metadata and controls
40 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react'
import { describe, expect, test } from '@jest/globals'
import renderer from 'react-test-renderer'
import GeneFlags from './GeneFlags'
import geneFactory from '../__factories__/Gene'
describe('GeneFlags', () => {
test('does not render any flags with basic gene', () => {
const testGene = geneFactory.build()
const tree = renderer.create(<GeneFlags gene={testGene} />)
expect(tree).toMatchSnapshot()
})
test('renders chip flag if present on gene', () => {
const testGene = geneFactory.build({ flags: ['chip'] })
const tree = renderer.create(<GeneFlags gene={testGene} />)
expect(tree).toMatchSnapshot()
})
test('renders CMRG flag if one of 3 relevant genes', () => {
const testGene = geneFactory.build({ symbol: 'CRYAA', reference_genome: 'GRCh38' })
const tree = renderer.create(<GeneFlags gene={testGene} />)
expect(tree).toMatchSnapshot()
})
test('renders VEP 115 warning for RNU4ATAC', () => {
const testGene = geneFactory.build({ symbol: 'RNU4ATAC', reference_genome: 'GRCh38' })
const tree = renderer.create(<GeneFlags gene={testGene} />)
expect(tree).toMatchSnapshot()
})
})