zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

Widget testing and Unit Testing examples #1135

Closed armandojimenez closed 2 years ago

armandojimenez commented 2 years ago

Is your feature request related to a problem? Please describe. I can't find any information on how to unit and widget test this package, especifically widgets and mocking, there is not any info online or tutorials or examples. Do you guys even do unit testing or widget testing with GraphQL?

Describe the solution you'd like Clear examples on how to widget test with this package.

Describe alternatives you've considered Looking for info or tutorials, there is none.

budde377 commented 2 years ago

Please have a look in the respective test folder for examples, e.g packages/graphql_flutter/test/widgets/query_test.dart

denes16 commented 1 year ago

How can i test widgets using the hooks?.

vincenzopalazzo commented 1 year ago

Mh I think this is not related to graphql library, you can call the server and check what the app contains inside the widget after the completition of the call.

In addition, this operation that required the usage of the network in flutter require to write integration testing, or you can just mock the server.