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

pull/600/head
Alexandru2909 2 years ago committed by mergify[bot]
parent c1afe4be80
commit e473136c8b

@ -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)
}

@ -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() }
}

Loading…
Cancel
Save