diff --git a/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateFactory.kt b/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateFactory.kt index 623c353..a645a7c 100644 --- a/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateFactory.kt +++ b/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateFactory.kt @@ -27,7 +27,8 @@ internal object TooltipViewStateFactory { imageUrl: String = "", customContent: Int? = null, isStatusBarVisible: Boolean = false, - arrowMargin: Int = 0 + arrowMargin: Int = 0, + isArrowVisible: Boolean = true ): TooltipViewState { val showcaseModel = ShowcaseModel( rectF = RectF(), @@ -67,7 +68,8 @@ internal object TooltipViewStateFactory { descriptionTextStyle = Typeface.NORMAL, titleTextFontFamily = "sans-serif", showDuration = 2000L, - isShowcaseViewVisibleIndefinitely = true + isShowcaseViewVisibleIndefinitely = true, + isArrowVisible = isArrowVisible ) return provideTooltipViewState(showcaseModel, absoluteArrowPosition, arrowMargin) } diff --git a/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateTest.kt b/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateTest.kt index 4ad282d..2479c2a 100644 --- a/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateTest.kt +++ b/library/src/test/java/com/trendyol/showcase/ui/tooltip/TooltipViewStateTest.kt @@ -190,6 +190,34 @@ class TooltipViewStateTest { actualResult `should be` expectedResult } + @Test + fun `Given isArrowVisible false, When getTopArrowVisibility called, Then it should return GONE`() { + // Given + val isArrowVisible = false + val expectedResult = View.GONE + val tooltipViewState = TooltipViewStateFactory.provideTooltipViewState(isArrowVisible = isArrowVisible) + + // When + val actualResult = tooltipViewState.getTopArrowVisibility() + + // Then + actualResult `should be` expectedResult + } + + @Test + fun `Given isArrowVisible false, When getBottomArrowVisibility called, Then it should return GONE`() { + // Given + val isArrowVisible = false + val expectedResult = View.GONE + val tooltipViewState = TooltipViewStateFactory.provideTooltipViewState(isArrowVisible = isArrowVisible) + + // When + val actualResult = tooltipViewState.getBottomArrowVisibility() + + // Then + actualResult `should be` expectedResult + } + @Test fun `when showCloseButton is true then getCloseButtonVisibility() returns VISIBLE`() { //when @@ -237,4 +265,4 @@ class TooltipViewStateTest { actualResult `should be` expectedResult } -} \ No newline at end of file +}