2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/27135 - Correctly report top sites for a11y services

This commit is contained in:
Alexandru2909 2022-10-18 12:57:50 +03:00 committed by mergify[bot]
parent c1afe4be80
commit e473136c8b
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ class TopSiteItemViewHolder(
private val binding = TopSiteItemBinding.bind(view)
init {
binding.topSiteItem.setOnLongClickListener {
itemView.setOnLongClickListener {
interactor.onTopSiteMenuOpened()
TopSites.longPress.record(TopSites.LongPressExtra(topSite.name()))
@ -72,7 +72,7 @@ class TopSiteItemViewHolder(
}
fun bind(topSite: TopSite, position: Int) {
binding.topSiteItem.setOnClickListener {
itemView.setOnClickListener {
interactor.onSelectTopSite(topSite, position)
}

View File

@ -58,7 +58,7 @@ class TopSiteItemViewHolderTest {
fun `calls interactor on click`() {
TopSiteItemViewHolder(binding.root, lifecycleOwner, interactor).bind(pocket, position = 0)
binding.topSiteItem.performClick()
binding.root.performClick()
verify { interactor.onSelectTopSite(pocket, position = 0) }
}
@ -67,7 +67,7 @@ class TopSiteItemViewHolderTest {
every { testContext.components.analytics } returns mockk(relaxed = true)
TopSiteItemViewHolder(binding.root, lifecycleOwner, interactor).bind(pocket, position = 0)
binding.topSiteItem.performLongClick()
binding.root.performLongClick()
verify { interactor.onTopSiteMenuOpened() }
}