Closed LuchoTurtle closed 5 months ago
Hey @LuchoTurtle, thanks for reporting this issue. The onEmojiSelected
callback seems to be invoked but only coverage seems not to be reported 🤔 I don't know what could cause this. I need to setup some widget tests myself and check it. If you find the reason in the meantime please keep me updated 👍
Thanks for the reply :)
I've found a way so onEmojiSelected
is covered. You can see a simple widget test in https://github.com/dwyl/app/blob/6439db5d922ae5a4a368dfc2bba03040e58db2fc/test/widget/emoji_widget_test.dart.
However, the only way I got this to work is having to disable the "Recents" emojis tab.
Config(recentTabBehavior: RecentTabBehavior.NONE);
This was the only way I could find to find.byText()
emojis to tap, thus invoking the onEmojiSelected
. Otherwise, even though I scrolled and changed tabs, it wasn't working on tests.
So hopefully this helps people in the future :).
Though it'd be fun to have a neat utility function that would allow us to input emojis without having to go through these hoops. 👀
Version 2.0 will include some basic tests. Thanks again @LuchoTurtle for your help 🙏 I will close this issue with the release of version 2.0.
Hey there! 👋
Thanks for the package, it's mighty useful!
I'm having a bit of trouble widget-testing an application that includes this package. Since there aren't any testing utilities that I can go for, to test my code I'm doing something like this in my test:
I'm always setting the size of the unit test to always be the same one so it works every time. The thing is, I'm simulating this test on a physical device and everything works out - it clicks on an emoji and it is inserted as text. You can check it in the video below:
https://github.com/dwyl/flutter-wysiwyg-editor-tutorial/assets/17494745/073706e9-2c7d-4942-8a77-8381827f51ca
However, even though all the unit tests pass and the integration tests pass, it seems the callback of the inserted emoji is not covered.
Has this happened to y'all? Why is the
onEmojiSelected
callback not being invoked during unit tests and being covered?If you're curious, you may see the offending file in https://github.com/dwyl/flutter-wysiwyg-editor-tutorial/pull/9/files#diff-64157eac151a0f2a28dff32d284fc4f62e2eaf53e0dd0a8c1cd31e77f56e700d.
Thank you!