Skip to content

Commit

Permalink
fixup: placate eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
phildarnowsky-broad committed Sep 6, 2024
1 parent 2293dff commit 6ccd21e
Showing 1 changed file with 44 additions and 48 deletions.
92 changes: 44 additions & 48 deletions graphql-api/src/queries/variant-datasets/shared/flags.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ describe('getFlagsForContext', () => {
'should be included only if there are LOFTEE annotated consequences in the specified gene, none of them are annotated HC, the highest ranked transcript is LOFTEE annotated, and the highest ranked transcript is not OS',
(geneId, expected) => {
expect(
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
'lc_lof'
)
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes('lc_lof')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
'lc_lof'
)
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('lc_lof')
).toBe(false)
})
})
Expand Down Expand Up @@ -115,7 +111,7 @@ describe('getFlagsForContext', () => {
'should be included only if there are LOFTEE annotated consequences, none of them are annotated HC, the highest ranked transcript is LOFTEE annotated, and the highest ranked transcript is not OS',
(variant, expected) => {
expect(
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('lc_lof')
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('lc_lof')
).toBe(expected)
}
)
Expand All @@ -141,18 +137,20 @@ describe('getFlagsForContext', () => {
'should be included only if the consequence in the specified transcript is LOFTEE annotated LC',
(transcriptId, expected) => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
'variantFlags'
].includes('lc_lof')
getFlagsForContext(
{ type: 'transcript', transcriptId },
variant
).variantFlags.includes('lc_lof')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
'variantFlags'
].includes('lc_lof')
getFlagsForContext(
{ type: 'transcript', transcriptId: 'T1' },
{}
).variantFlags.includes('lc_lof')
).toBe(false)
})
})
Expand Down Expand Up @@ -187,7 +185,7 @@ describe('getFlagsForContext', () => {
'should be included only if there are LOFTEE annotated consequences in the specified gene and all of them are LOFTEE flagged',
(geneId, expected) => {
expect(
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes(
'lof_flag'
)
).toBe(expected)
Expand All @@ -196,9 +194,7 @@ describe('getFlagsForContext', () => {

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
'lof_flag'
)
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('lof_flag')
).toBe(false)
})
})
Expand Down Expand Up @@ -248,7 +244,7 @@ describe('getFlagsForContext', () => {
'should be included only if there are LOFTEE annotated consequences and all of them are LOFTEE flagged',
(variant, expected) => {
expect(
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('lof_flag')
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('lof_flag')
).toBe(expected)
}
)
Expand All @@ -272,18 +268,20 @@ describe('getFlagsForContext', () => {
'should be included only if the consequence in the specified transcript is LOFTEE annotated and LOFTEE flagged',
(transcriptId, expected) => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
'variantFlags'
].includes('lof_flag')
getFlagsForContext(
{ type: 'transcript', transcriptId },
variant
).variantFlags.includes('lof_flag')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
'variantFlags'
].includes('lof_flag')
getFlagsForContext(
{ type: 'transcript', transcriptId: 'T1' },
{}
).variantFlags.includes('lof_flag')
).toBe(false)
})
})
Expand Down Expand Up @@ -312,7 +310,7 @@ describe('getFlagsForContext', () => {
'it should be included only if the most severe consequence in the specified gene is pLoF according to VEP but not LOFTEE annotated',
(geneId, expected) => {
expect(
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes(
'nc_transcript'
)
).toBe(expected)
Expand All @@ -321,7 +319,7 @@ describe('getFlagsForContext', () => {

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes(
'nc_transcript'
)
).toBe(false)
Expand Down Expand Up @@ -362,9 +360,7 @@ describe('getFlagsForContext', () => {
'it should be included only if the most severe consequence is pLoF according to VEP but not LOFTEE annotated',
(variant, expected) => {
expect(
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes(
'nc_transcript'
)
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('nc_transcript')
).toBe(expected)
}
)
Expand Down Expand Up @@ -403,18 +399,20 @@ describe('getFlagsForContext', () => {
'it should be included only if the consequence in the specified transcript is pLoF according to VEP but not LOFTEE annotated',
(transcriptId, expected) => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
'variantFlags'
].includes('nc_transcript')
getFlagsForContext(
{ type: 'transcript', transcriptId },
variant
).variantFlags.includes('nc_transcript')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
'variantFlags'
].includes('nc_transcript')
getFlagsForContext(
{ type: 'transcript', transcriptId: 'T1' },
{}
).variantFlags.includes('nc_transcript')
).toBe(false)
})
})
Expand Down Expand Up @@ -446,18 +444,14 @@ describe('getFlagsForContext', () => {
'it should be included only if the most severe consequence in the specified gene is LOFTEE annotated OS',
(geneId, expected) => {
expect(
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
'os_lof'
)
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes('os_lof')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
'os_lof'
)
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('os_lof')
).toBe(false)
})
})
Expand Down Expand Up @@ -488,7 +482,7 @@ describe('getFlagsForContext', () => {
'it should be included only if the most severe consequence is LOFTEE annotated OS',
(variant, expected) => {
expect(
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('os_lof')
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('os_lof')
).toBe(expected)
}
)
Expand All @@ -514,18 +508,20 @@ describe('getFlagsForContext', () => {
'it should be included only if the consequence in the specified transcript is LOFTEE annotated OS',
(transcriptId, expected) => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
'variantFlags'
].includes('os_lof')
getFlagsForContext(
{ type: 'transcript', transcriptId },
variant
).variantFlags.includes('os_lof')
).toBe(expected)
}
)

it('should not be included for variants without consequences', () => {
expect(
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
'variantFlags'
].includes('os_lof')
getFlagsForContext(
{ type: 'transcript', transcriptId: 'T1' },
{}
).variantFlags.includes('os_lof')
).toBe(false)
})
})
Expand Down

0 comments on commit 6ccd21e

Please sign in to comment.