[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/21335: return self instead of mock in FenixSnackbarKtTest.

This is a speculative fix for the intermittent issue. Typically, these
intermittents are caused by mocked lambdas but there is no mocked lambda
here. If this doesn't work, one `any()` argument fills in for a lambda:
it's possible that's causing the failure.

Unfortunately, I can't verify this fix easily because the "run test until
failure" option was removed from Android Studio.

See d396c9eb41298cc07fbf136f1de971010bc45d97 for a prior attempt to
address the intermittents in this class.
pull/600/head
Michael Comella 3 years ago committed by mergify[bot]
parent c2d385f142
commit 8d5a7606f4

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.tabstray.ext
import android.content.Context
@ -74,7 +78,7 @@ class FenixSnackbarKtTest {
every { snackbar.setAnchorView(anchor) }.answers { snackbar }
every { snackbar.view }.answers { view }
every { snackbar.setAction(any(), any()) }.answers { mockk(relaxed = true) }
every { snackbar.setAction(any(), any()) }.answers { snackbar }
every { snackbar.anchorView }.answers { anchor }
snackbar.anchorWithAction(anchor, {})

Loading…
Cancel
Save