Skip to content

Commit

Permalink
Update ReaderTopBarMenuHelperTest
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed Jun 5, 2024
1 parent cdc8c53 commit 03b73d8
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ class ReaderTopBarMenuHelperTest {
assertThat(customList3Item.text).isEqualTo(UiStringText("custom-list-3"))
}

@Test
fun `GIVEN custom lists has 2 items or less WHEN createMenu THEN custom lists items are shown outside a submenu`() {
val tags = ReaderTagList().apply {
add(mockFollowingTag()) // item 0
add(mockDiscoverTag()) // item 1
add(mockSavedTag()) // item 2
add(mockLikedTag()) // item 3
add(mockA8CTag()) // item 4
add(mockFollowedP2sTag()) // item 5
add(createCustomListTag("custom-list-1")) // item 6
add(createCustomListTag("custom-list-2")) // item 7
}
val menu = helper.createMenu(tags)

val customListItem1 = menu.findSingleItem { it.id == "6" }!!
assertThat(customListItem1.text).isEqualTo(UiStringText("custom-list-1"))

val customListItem2 = menu.findSingleItem { it.id == "7" }!!
assertThat(customListItem2.text).isEqualTo(UiStringText("custom-list-2"))
}

@Test
fun `GIVEN all tags are available and tags FF enabled WHEN createMenu THEN all items are created correctly`() {
whenever(readerTagsFeedFeatureConfig.isEnabled()).thenReturn(true)
Expand Down

0 comments on commit 03b73d8

Please sign in to comment.