test: add coverage for CreateDeckDialog.displayFeedback()#20291
test: add coverage for CreateDeckDialog.displayFeedback()#20291siddhesh-06 wants to merge 3 commits intoankidroid:mainfrom
Conversation
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
|
Hi, this looks AI generated to me. Can I confirm you've read our AI policy: https://github.com/ankidroid/Anki-Android/blob/main/AI_POLICY.md |
Hello @david-allison, I consulted AI as a learning aid for 3–4 test cases where |
|
A revert would be appreciated, leaving the test name/description with an Thanks for your honesty. TRULY!!! |
There was a problem hiding this comment.
You'll also want to remove the implementations which are AI generated, they're far too verbose and don't fit the idioms of our codebase and this file, for example:
There was a problem hiding this comment.
I’ve removed the verbose patterns and updated the test cases so they match the codebase idioms.
There was a problem hiding this comment.
This is still using CreateDeckDialog(
There was a problem hiding this comment.
I added the withCreateDeckDialogUsingApplicationContext method, which creates an instance of CreateDeckDialog using the application context. Currently, we only have CreateDeckDialog for the activity context, implemented via withCreateDeckDialog. 🤔
Purpose / Description
Added test coverage for
displayFeedback()method inCreateDeckDialog@NeedsTestannotation and implemented 5 test cases coveringToast(non-Activity context)Toastis displayed for application context.LENGTH_SHORTandLENGTH_LONGdurations, empty messages, and multiple sequential is correctly displayed to usersFixes
Fixes #13283
How Has This Been Tested?
Ran ./gradlew jacocoUnitTestReport
Checklist
Please, go through these checks before submitting the PR.