Skip to content

Commit

Permalink
chore: improved datset query coverage
Browse files Browse the repository at this point in the history
- discovered bug (unknown dataset id returns results)
  • Loading branch information
brouillette committed Jul 10, 2023
1 parent 2340082 commit 1048d3f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/api/tests/build/api/variants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ func TestDemoVcfIngestion(t *testing.T) {
byDatsetQueryResponse := common.BuildQueryAndMakeGetVariantsCall("", "*", dataset, true, "asc", "", "GRCh38", "", "", "", false, t, cfg)
assert.True(t, len(byDatsetQueryResponse.Results) > 0)
assert.True(t, len(byDatsetQueryResponse.Results[0].Calls) > 0)
// verify dataset ids
From(byDatsetQueryResponse.Results).SelectManyT(func(data dtos.VariantGetResult) Query { // *
return From(data.Calls)
}).ForEachT(func(variant dtos.VariantCall) {
assert.Equal(t, dataset.String(), variant.Dataset)
})

// test unknown random dataset id
shouldBeEmptyResponse := common.BuildQueryAndMakeGetVariantsCall("", "*", uuid.New(), true, "", "", "GRCh38", "", "", "", false, t, cfg)
assert.True(t, len(shouldBeEmptyResponse.Results) > 0)
assert.True(t, len(shouldBeEmptyResponse.Results[0].Calls) == 0)
})

t.Run("Test Simple Allele Queries", func(t *testing.T) {
Expand Down

0 comments on commit 1048d3f

Please sign in to comment.