Skip to content

Commit

Permalink
Remove duplicated test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Garanzha committed Jan 23, 2019
1 parent 6d6f08e commit 304b29e
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions tests/dataloader/dataloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,62 +276,6 @@ func TestDataLoaderWithSwagger(t *testing.T) {
}`, response)
}

func TestDataLoaderWithGRPCFieldUnwrappingResponseScalar(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

itemsClient := mock.NewMockItemsServiceClient(mockCtrl)
itemsClient.EXPECT().GetOne(gomock.Any(), gomock.Any()).Return(&apis.Item{
Name: "item 1",
CategoryId: 12,
}, nil).AnyTimes()

reviewsClient := mock.NewMockItemsReviewServiceClient(mockCtrl)
reviewsClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(&apis.ListResponse{
ItemReviews: []*apis.ItemReviews{
{
ItemReview: []*apis.Review{
{
Id: 456,
Text: "excellent item",
},
},
},
},
}, nil).AnyTimes()

clients := &mock.Clients{
ItemsClient: itemsClient,
ReviewsClient: reviewsClient,
}

response := makeRequest(t, clients, &handler.RequestOptions{
Query: `{
items {
GetOne {
reviews {
text
}
}
}
}`,
})

tests.AssertJSON(t, `{
"data": {
"items": {
"GetOne": {
"reviews": [
{
"text": "excellent item"
}
]
}
}
}
}`, response)
}

func TestDataLoaderWithProtoFieldUnwrapping(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
Expand Down

0 comments on commit 304b29e

Please sign in to comment.