-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test : Check Snackbar is displayed when the deck is created #16033
Test : Check Snackbar is displayed when the deck is created #16033
Conversation
AnkiDroid/src/androidTest/java/com/ichi2/anki/dialogs/CreateDeckDialogTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer Robolectric (/test/
) over /androidTest/
unless there's a good reason
(don't worry about the GSoC deadline regarding testing, we can still talk about it afterwards)
757d1a8
to
497792b
Compare
Few Doubts: @david-allison
For now I have just fixed my old instrument test. |
If you Then look at the history of the class to understand how things have changed over time See from the git history for the file: be85b46 (ShowSnackbarInsteadOfToast) The intention of the So test for snackbars, not toasts, and as above, use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as below
Hi Maintainers, I am unsure of how can I check if the Snackbar is displayed or not in Roboelectric? There used to be shadowsnackbar but its now deprecated. Can you share me what method do we have to test snackbar or any resource link? |
This should be in Closing this as stale to reduce our number of pending PRs. I was going to fix this up, but it needs a rewrite. Feel free to recreate when this is done |
Purpose / Description
This test checks whether the toast is shown to user after the deck has been created.
Fix
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/CreateDeckDialog.kt
Line 50 in 1c5a6b3
Note :
I am currently new towards writing test feel free to pin out or recommend the mistakes or advise while testing.