@@ -312,10 +312,10 @@ class ReaderPostUiStateBuilderTest : BaseUnitTest() {
312312
313313 // region FEATURED IMAGE
314314 @Test
315- fun `featured image is displayed for photo and default card types` () = test {
315+ fun `featured image is displayed for supported card types` () = test {
316316 // Arrange
317317 val dummyUrl = " 12345"
318- ReaderCardType .values().filter { it == PHOTO || it == DEFAULT }.forEach {
318+ ReaderCardType .values().filter { it != GALLERY }.forEach {
319319 val post = createPost(cardType = it, hasFeaturedImage = true , featuredImageUrlForDisplay = dummyUrl)
320320 // Act
321321 val uiState = mapPostToUiState(post)
@@ -325,10 +325,10 @@ class ReaderPostUiStateBuilderTest : BaseUnitTest() {
325325 }
326326
327327 @Test
328- fun `featured image is displayed for photo and default card types for new UI` () = test {
328+ fun `featured image is displayed for supported card types for new UI` () = test {
329329 // Arrange
330330 val dummyUrl = " 12345"
331- ReaderCardType .values().filter { it == PHOTO || it == DEFAULT }.forEach {
331+ ReaderCardType .values().filter { it != GALLERY }.forEach {
332332 val post = createPost(cardType = it, hasFeaturedImage = true , featuredImageUrlForDisplay = dummyUrl)
333333 // Act
334334 val uiState = mapPostToUiState(post)
@@ -338,27 +338,23 @@ class ReaderPostUiStateBuilderTest : BaseUnitTest() {
338338 }
339339
340340 @Test
341- fun `featured image is not displayed for other than photo and default card types ` () = test {
341+ fun `featured image is not displayed for gallery card type ` () = test {
342342 // Arrange
343- ReaderCardType .values().filter { it != PHOTO && it != DEFAULT }.forEach {
344- val post = createPost(cardType = it, hasFeaturedImage = true )
345- // Act
346- val uiState = mapPostToUiState(post)
347- // Assert
348- assertThat(uiState.featuredImageUrl).isNull()
349- }
343+ val post = createPost(cardType = GALLERY , hasFeaturedImage = true )
344+ // Act
345+ val uiState = mapPostToUiState(post)
346+ // Assert
347+ assertThat(uiState.featuredImageUrl).isNull()
350348 }
351349
352350 @Test
353- fun `featured image is not displayed for other than photo and default card types for new UI` () = test {
351+ fun `featured image is not displayed for gallery card type for new UI` () = test {
354352 // Arrange
355- ReaderCardType .values().filter { it != PHOTO && it != DEFAULT }.forEach {
356- val post = createPost(cardType = it, hasFeaturedImage = true )
357- // Act
358- val uiState = mapPostToUiState(post)
359- // Assert
360- assertThat(uiState.featuredImageUrl).isNull()
361- }
353+ val post = createPost(cardType = GALLERY , hasFeaturedImage = true )
354+ // Act
355+ val uiState = mapPostToUiState(post)
356+ // Assert
357+ assertThat(uiState.featuredImageUrl).isNull()
362358 }
363359
364360 @Test
@@ -380,6 +376,21 @@ class ReaderPostUiStateBuilderTest : BaseUnitTest() {
380376 // Assert
381377 assertThat(uiState.featuredImageUrl).isNull()
382378 }
379+
380+ @Test
381+ fun `video card shows featured media area when only video is available` () = test {
382+ // Arrange
383+ val post = createPost(
384+ cardType = VIDEO ,
385+ hasFeaturedVideo = true ,
386+ featuredVideoUrl = " video://example" ,
387+ hasFeaturedImage = false
388+ )
389+ // Act
390+ val uiState = mapPostToUiState(post)
391+ // Assert
392+ assertThat(uiState.featuredImageVisibility).isTrue
393+ }
383394 // endregion
384395
385396 // region TITLE & EXCERPT
0 commit comments