/* 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.tabtray

import io.mockk.mockk
import io.mockk.verify
import org.junit.Test

class TabTrayFragmentInteractorTest {
    private val controller = mockk<TabTrayController>(relaxed = true)
    private val interactor = TabTrayFragmentInteractor(controller)

    @Test
    fun onNewTabTapped() {
        interactor.onNewTabTapped(private = true)
        verify { controller.onNewTabTapped(true) }

        interactor.onNewTabTapped(private = false)
        verify { controller.onNewTabTapped(false) }
    }

    @Test
    fun onTabTrayDismissed() {
        interactor.onTabTrayDismissed()
        verify { controller.onTabTrayDismissed() }
    }

    @Test
    fun onShareTabsClicked() {
        interactor.onShareTabsClicked(private = true)
        verify { controller.onShareTabsClicked(true) }

        interactor.onShareTabsClicked(private = false)
        verify { controller.onShareTabsClicked(false) }
    }

    @Test
    fun onSaveToCollectionClicked() {
        interactor.onSaveToCollectionClicked()
        verify { controller.onSaveToCollectionClicked() }
    }

    @Test
    fun onCloseAllTabsClicked() {
        interactor.onCloseAllTabsClicked(private = false)
        verify { controller.onCloseAllTabsClicked(false) }

        interactor.onCloseAllTabsClicked(private = true)
        verify { controller.onCloseAllTabsClicked(true) }
    }
}
