rodydavis / pocketbase_ui

Other
4 stars 0 forks source link

Easy widget test approach #1

Closed rubensdemelo closed 7 months ago

rubensdemelo commented 8 months ago

Hi Rod, I have a question about the easiest way to test widgets (ie MyHomePage):

          ValueListenableBuilder(
            valueListenable: App.of(context).themeMode,

App and AppState should be mocked and injected into the widget tree to test all possible states.

Just building the widget, without testing anything related to the state, would be useful to mock only App?

Thanks

rodydavis commented 7 months ago

Yes totally, this was an example that I was building out for some apps exploring PocketBase. I wanted to stop repeating all the auth logic in my apps.

Haven't updated the example recently!

This is a great callout!