Bug 1858925 - Fix `homepageUrl` field on the `Addon` class

fenix/120.0
William Durand 8 months ago committed by mergify[bot]
parent 1d97ba7922
commit 8d1afeec60

@ -53,7 +53,7 @@ class AddonDetailsBindingDelegate(
bindAuthor(addon) bindAuthor(addon)
bindVersion(addon) bindVersion(addon)
bindLastUpdated(addon) bindLastUpdated(addon)
bindWebsite(addon) bindHomepage(addon)
bindRating(addon) bindRating(addon)
} }
@ -75,15 +75,15 @@ class AddonDetailsBindingDelegate(
} }
} }
private fun bindWebsite(addon: Addon) { private fun bindHomepage(addon: Addon) {
if (addon.siteUrl.isBlank()) { if (addon.homepageUrl.isBlank()) {
binding.homePageLabel.isVisible = false binding.homePageLabel.isVisible = false
binding.homePageDivider.isVisible = false binding.homePageDivider.isVisible = false
return return
} }
binding.homePageLabel.setOnClickListener { binding.homePageLabel.setOnClickListener {
interactor.openWebsite(addon.siteUrl.toUri()) interactor.openWebsite(addon.homepageUrl.toUri())
} }
} }

@ -87,10 +87,10 @@ class AddonDetailsBindingDelegateTest {
} }
@Test @Test
fun `bind addons website`() { fun `bind addons homepage`() {
detailsBindingDelegate.bind( detailsBindingDelegate.bind(
baseAddon.copy( baseAddon.copy(
siteUrl = "https://mozilla.org", homepageUrl = "https://mozilla.org",
), ),
) )
@ -187,7 +187,7 @@ class AddonDetailsBindingDelegateTest {
@Test @Test
fun `bind without a home page`() { fun `bind without a home page`() {
detailsBindingDelegate.bind(baseAddon.copy(siteUrl = "")) detailsBindingDelegate.bind(baseAddon.copy(homepageUrl = ""))
assertFalse(binding.homePageLabel.isVisible) assertFalse(binding.homePageLabel.isVisible)
assertFalse(binding.homePageDivider.isVisible) assertFalse(binding.homePageDivider.isVisible)

Loading…
Cancel
Save