Skip to content

Commit 6ccd21e

Browse files
fixup: placate eslint
1 parent 2293dff commit 6ccd21e

File tree

1 file changed

+44
-48
lines changed

1 file changed

+44
-48
lines changed

graphql-api/src/queries/variant-datasets/shared/flags.spec.ts

+44-48
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,14 @@ describe('getFlagsForContext', () => {
4444
'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',
4545
(geneId, expected) => {
4646
expect(
47-
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
48-
'lc_lof'
49-
)
47+
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes('lc_lof')
5048
).toBe(expected)
5149
}
5250
)
5351

5452
it('should not be included for variants without consequences', () => {
5553
expect(
56-
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
57-
'lc_lof'
58-
)
54+
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('lc_lof')
5955
).toBe(false)
6056
})
6157
})
@@ -115,7 +111,7 @@ describe('getFlagsForContext', () => {
115111
'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',
116112
(variant, expected) => {
117113
expect(
118-
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('lc_lof')
114+
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('lc_lof')
119115
).toBe(expected)
120116
}
121117
)
@@ -141,18 +137,20 @@ describe('getFlagsForContext', () => {
141137
'should be included only if the consequence in the specified transcript is LOFTEE annotated LC',
142138
(transcriptId, expected) => {
143139
expect(
144-
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
145-
'variantFlags'
146-
].includes('lc_lof')
140+
getFlagsForContext(
141+
{ type: 'transcript', transcriptId },
142+
variant
143+
).variantFlags.includes('lc_lof')
147144
).toBe(expected)
148145
}
149146
)
150147

151148
it('should not be included for variants without consequences', () => {
152149
expect(
153-
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
154-
'variantFlags'
155-
].includes('lc_lof')
150+
getFlagsForContext(
151+
{ type: 'transcript', transcriptId: 'T1' },
152+
{}
153+
).variantFlags.includes('lc_lof')
156154
).toBe(false)
157155
})
158156
})
@@ -187,7 +185,7 @@ describe('getFlagsForContext', () => {
187185
'should be included only if there are LOFTEE annotated consequences in the specified gene and all of them are LOFTEE flagged',
188186
(geneId, expected) => {
189187
expect(
190-
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
188+
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes(
191189
'lof_flag'
192190
)
193191
).toBe(expected)
@@ -196,9 +194,7 @@ describe('getFlagsForContext', () => {
196194

197195
it('should not be included for variants without consequences', () => {
198196
expect(
199-
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
200-
'lof_flag'
201-
)
197+
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('lof_flag')
202198
).toBe(false)
203199
})
204200
})
@@ -248,7 +244,7 @@ describe('getFlagsForContext', () => {
248244
'should be included only if there are LOFTEE annotated consequences and all of them are LOFTEE flagged',
249245
(variant, expected) => {
250246
expect(
251-
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('lof_flag')
247+
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('lof_flag')
252248
).toBe(expected)
253249
}
254250
)
@@ -272,18 +268,20 @@ describe('getFlagsForContext', () => {
272268
'should be included only if the consequence in the specified transcript is LOFTEE annotated and LOFTEE flagged',
273269
(transcriptId, expected) => {
274270
expect(
275-
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
276-
'variantFlags'
277-
].includes('lof_flag')
271+
getFlagsForContext(
272+
{ type: 'transcript', transcriptId },
273+
variant
274+
).variantFlags.includes('lof_flag')
278275
).toBe(expected)
279276
}
280277
)
281278

282279
it('should not be included for variants without consequences', () => {
283280
expect(
284-
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
285-
'variantFlags'
286-
].includes('lof_flag')
281+
getFlagsForContext(
282+
{ type: 'transcript', transcriptId: 'T1' },
283+
{}
284+
).variantFlags.includes('lof_flag')
287285
).toBe(false)
288286
})
289287
})
@@ -312,7 +310,7 @@ describe('getFlagsForContext', () => {
312310
'it should be included only if the most severe consequence in the specified gene is pLoF according to VEP but not LOFTEE annotated',
313311
(geneId, expected) => {
314312
expect(
315-
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
313+
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes(
316314
'nc_transcript'
317315
)
318316
).toBe(expected)
@@ -321,7 +319,7 @@ describe('getFlagsForContext', () => {
321319

322320
it('should not be included for variants without consequences', () => {
323321
expect(
324-
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
322+
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes(
325323
'nc_transcript'
326324
)
327325
).toBe(false)
@@ -362,9 +360,7 @@ describe('getFlagsForContext', () => {
362360
'it should be included only if the most severe consequence is pLoF according to VEP but not LOFTEE annotated',
363361
(variant, expected) => {
364362
expect(
365-
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes(
366-
'nc_transcript'
367-
)
363+
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('nc_transcript')
368364
).toBe(expected)
369365
}
370366
)
@@ -403,18 +399,20 @@ describe('getFlagsForContext', () => {
403399
'it should be included only if the consequence in the specified transcript is pLoF according to VEP but not LOFTEE annotated',
404400
(transcriptId, expected) => {
405401
expect(
406-
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
407-
'variantFlags'
408-
].includes('nc_transcript')
402+
getFlagsForContext(
403+
{ type: 'transcript', transcriptId },
404+
variant
405+
).variantFlags.includes('nc_transcript')
409406
).toBe(expected)
410407
}
411408
)
412409

413410
it('should not be included for variants without consequences', () => {
414411
expect(
415-
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
416-
'variantFlags'
417-
].includes('nc_transcript')
412+
getFlagsForContext(
413+
{ type: 'transcript', transcriptId: 'T1' },
414+
{}
415+
).variantFlags.includes('nc_transcript')
418416
).toBe(false)
419417
})
420418
})
@@ -446,18 +444,14 @@ describe('getFlagsForContext', () => {
446444
'it should be included only if the most severe consequence in the specified gene is LOFTEE annotated OS',
447445
(geneId, expected) => {
448446
expect(
449-
getFlagsForContext({ type: 'gene', geneId }, variant)['variantFlags'].includes(
450-
'os_lof'
451-
)
447+
getFlagsForContext({ type: 'gene', geneId }, variant).variantFlags.includes('os_lof')
452448
).toBe(expected)
453449
}
454450
)
455451

456452
it('should not be included for variants without consequences', () => {
457453
expect(
458-
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {})['variantFlags'].includes(
459-
'os_lof'
460-
)
454+
getFlagsForContext({ type: 'gene', geneId: 'G1' }, {}).variantFlags.includes('os_lof')
461455
).toBe(false)
462456
})
463457
})
@@ -488,7 +482,7 @@ describe('getFlagsForContext', () => {
488482
'it should be included only if the most severe consequence is LOFTEE annotated OS',
489483
(variant, expected) => {
490484
expect(
491-
getFlagsForContext({ type: 'region' }, variant)['variantFlags'].includes('os_lof')
485+
getFlagsForContext({ type: 'region' }, variant).variantFlags.includes('os_lof')
492486
).toBe(expected)
493487
}
494488
)
@@ -514,18 +508,20 @@ describe('getFlagsForContext', () => {
514508
'it should be included only if the consequence in the specified transcript is LOFTEE annotated OS',
515509
(transcriptId, expected) => {
516510
expect(
517-
getFlagsForContext({ type: 'transcript', transcriptId }, variant)[
518-
'variantFlags'
519-
].includes('os_lof')
511+
getFlagsForContext(
512+
{ type: 'transcript', transcriptId },
513+
variant
514+
).variantFlags.includes('os_lof')
520515
).toBe(expected)
521516
}
522517
)
523518

524519
it('should not be included for variants without consequences', () => {
525520
expect(
526-
getFlagsForContext({ type: 'transcript', transcriptId: 'T1' }, {})[
527-
'variantFlags'
528-
].includes('os_lof')
521+
getFlagsForContext(
522+
{ type: 'transcript', transcriptId: 'T1' },
523+
{}
524+
).variantFlags.includes('os_lof')
529525
).toBe(false)
530526
})
531527
})

0 commit comments

Comments
 (0)