Style items with height:100% should fill the scroll view's 60px cross-axis
| 198 | |
| 199 | // Style items with height:100% should fill the scroll view's 60px cross-axis |
| 200 | TEST_F(StyleCarouselLayoutTest, styleItemsFillCarouselHeight) { |
| 201 | auto l = buildCarousel(); |
| 202 | |
| 203 | YGNodeCalculateLayout(l.root, kScreenWidth, kScreenHeight, YGDirectionLTR); |
| 204 | dumpLayout(l); |
| 205 | |
| 206 | float carouselLayoutHeight = YGNodeLayoutGetHeight(l.carouselLayout); |
| 207 | ASSERT_FLOAT_EQ(kCarouselHeight, carouselLayoutHeight) |
| 208 | << "Carousel layout should be 60px"; |
| 209 | |
| 210 | float scrollViewHeight = YGNodeLayoutGetHeight(l.scrollView); |
| 211 | ASSERT_GT(scrollViewHeight, 0) << "ScrollView should have non-zero height"; |
| 212 | EXPECT_FLOAT_EQ(kCarouselHeight, scrollViewHeight) |
| 213 | << "ScrollView should fill the 60px carousel height"; |
| 214 | |
| 215 | for (int i = 0; i < kStyleItemCount; i++) { |
| 216 | float itemHeight = YGNodeLayoutGetHeight(l.styleItems[i]); |
| 217 | EXPECT_FLOAT_EQ(scrollViewHeight, itemHeight) |
| 218 | << "Style item " << i << " with height:100% should equal scroll view height (" |
| 219 | << scrollViewHeight << "), got " << itemHeight; |
| 220 | } |
| 221 | |
| 222 | YGNodeFreeRecursive(l.root); |
| 223 | } |
| 224 | |
| 225 | // The inner container (height:55%) should be vertically centered in the 60px bar |
| 226 | TEST_F(StyleCarouselLayoutTest, innerContainerVerticallyCentered) { |
nothing calls this directly
no test coverage detected