Skip to content
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

Added Unit test for onDeckSelected #16366

Closed
wants to merge 2 commits into from

Conversation

Haz3-jolt
Copy link
Contributor

Purpose / Description

Added Unit test to function with @NeedsTest.

Fixes

  • Created test for onDeckSelected to address "15448: double-selecting deck does nothing".

Approach

  • Unit test completed.

How Has This Been Tested?

  • Ran the Unit test multiple times, and ensured it is passing.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop the ContentProvider commit so we can merge the onDeckSelected test

Comment on lines +43 to +46
fun makeBackendUsableDoesNotThrowException() {
val context = ApplicationProvider.getApplicationContext<Context>()
AnkiAssert.assertDoesNotThrow { AnkiDroidApp.makeBackendUsable(context) }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If makeBackendUsable is removed here, does this test fail?

    override fun onCreate(): Boolean {
        // Initialize content provider on startup.
        Timber.d("CardContentProvider: onCreate")
-        AnkiDroidApp.makeBackendUsable(context!!)
        return true
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey this PR was messed up, will redo

@Haz3-jolt Haz3-jolt closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants