Home > OS >  Flutter Widget Testing and Integration Testing
Flutter Widget Testing and Integration Testing

Time:09-01

I have a small to mid sized application having several individual components (eg:- primary button) and several screens (eg:- login screen) where screens are a composition of these individual components and other flutter built in widgets.

Should I be writing widget tests for individual components to check edge cases like handling long texts and overflow issues on smaller or larger devices or write widget tests for entire screens? Here I'll only be testing the cosmetic behaviour of the application screens or widgets?

As for integration testing, I'm assuming it would test the entire functionality of the app, i.e. the screens using blocs (PS: I'm using flutter bloc and redux in conjunction)

CodePudding user response:

I'm sorry to say that this question will be closed because it is opinon-based and doesn't follow the guidelines for StackOverflow. But let me give my two cents about it.

The important things in your app should be tested, to make sure functionality isn't broken when changes occur. Meaning that, if it is very important that the UI looks a certain way, then "lock it down" with tests.

If business logic is very important (which it absolutely should be imo), then "lock it down" with tests.

  • Related