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

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

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

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

Loading…
Cancel
Save