Bug 1820467 - Removed dependency to google_material from support-ktx gradle. (https...
[gecko.git] / mobile / android / fenix / app / src / test / java / org / mozilla / fenix / gleanplumb / MessagingFeatureTest.kt
blob31538504eb98610ca37ce7c968717ca3c7f583f2
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.fenix.gleanplumb
7 import io.mockk.spyk
8 import io.mockk.verify
9 import kotlinx.coroutines.ExperimentalCoroutinesApi
10 import mozilla.components.support.test.rule.MainCoroutineRule
11 import org.junit.Rule
12 import org.junit.Test
13 import org.mozilla.fenix.components.AppStore
14 import org.mozilla.fenix.components.appstate.AppAction.MessagingAction
15 import org.mozilla.fenix.nimbus.MessageSurfaceId
17 class MessagingFeatureTest {
18     @OptIn(ExperimentalCoroutinesApi::class)
19     @get:Rule
20     val coroutinesTestRule = MainCoroutineRule()
22     @Test
23     fun `WHEN start is called THEN evaluate messages`() {
24         val appStore: AppStore = spyk(AppStore())
25         val binding = MessagingFeature(appStore)
27         binding.start()
29         verify { appStore.dispatch(MessagingAction.Evaluate(MessageSurfaceId.HOMESCREEN)) }
30     }