Skip to content

Commit

Permalink
Merge pull request #18466 from wordpress-mobile/task/adds-domain-regi…
Browse files Browse the repository at this point in the history
…stration-indashboard

Adds domain registration card on dashboard
  • Loading branch information
Antonis Lilis authored May 19, 2023
2 parents 2929cc5 + 90f6291 commit 4d2eff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -814,13 +814,13 @@ class MySiteViewModel @Inject constructor(
}
add(Type.QUICK_LINK_RIBBON)
add(Type.JETPACK_INSTALL_FULL_PLUGIN_CARD)
add(Type.DOMAIN_REGISTRATION_CARD)
}

MySiteTabType.DASHBOARD -> mutableListOf<Type>().apply {
if (defaultTab == MySiteTabType.SITE_MENU) {
add(Type.QUICK_START_CARD)
}
add(Type.DOMAIN_REGISTRATION_CARD)
add(Type.QUICK_ACTIONS_CARD)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2960,23 +2960,23 @@ class MySiteViewModelTest : BaseUnitTest() {
}

@Test
fun `given selected site with domain credit, when dashboard cards + items, then domain reg card does not exist`() {
fun `given selected site with domain credit, when dashboard cards + items, then domain reg card exists`() {
initSelectedSite()
isDomainCreditAvailable.value = DomainCreditAvailable(true)

val items = (uiModels.last().state as SiteSelected).dashboardCardsAndItems

assertThat(items.filterIsInstance(DomainRegistrationCard::class.java)).isEmpty()
assertThat(items.filterIsInstance(DomainRegistrationCard::class.java)).isNotEmpty
}

@Test
fun `given selected site with domain credit, when site menu cards and items, then domain reg card exists`() {
fun `given selected site with domain credit, when site menu cards and items, then domain reg card doesn't exist`() {
initSelectedSite()
isDomainCreditAvailable.value = DomainCreditAvailable(true)

val items = (uiModels.last().state as SiteSelected).siteMenuCardsAndItems

assertThat(items.filterIsInstance(DomainRegistrationCard::class.java)).isNotEmpty
assertThat(items.filterIsInstance(DomainRegistrationCard::class.java)).isEmpty()
}

@Test
Expand Down

0 comments on commit 4d2eff9

Please sign in to comment.