-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into raja/filerenaming
- Loading branch information
Showing
24 changed files
with
834 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+2.83 KB
...TUIFloatingNavButtonScreenShotTest__floatingNavBurgerButton_darkTheme_false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.47 KB
....TUIFloatingNavButtonScreenShotTest__floatingNavBurgerButton_darkTheme_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.75 KB
...shots.TUIFloatingNavButtonScreenShotTest__floatingNavButton_darkTheme_false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.15 KB
...nshots.TUIFloatingNavButtonScreenShotTest__floatingNavButton_darkTheme_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.12 KB
...s.TUIFloatingNavButtonScreenShotTest__floatingNavListButton_darkTheme_false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.75 KB
...ts.TUIFloatingNavButtonScreenShotTest__floatingNavListButton_darkTheme_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.31 KB
...loatingNavButtonScreenShotTest__floatingNavViewToggleButton_darkTheme_false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.65 KB
...FloatingNavButtonScreenShotTest__floatingNavViewToggleButton_darkTheme_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUIDividerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.tarkalabs.uicomponents | ||
|
||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import com.tarkalabs.uicomponents.components.Orientation.HORIZONTAL | ||
import com.tarkalabs.uicomponents.components.TUIDivider | ||
import com.tarkalabs.uicomponents.components.TUIDividerTags | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class TUIDividerTest { | ||
@get:Rule val composeTestRule = createComposeRule() | ||
|
||
private val tags = TUIDividerTags(parentTag = "testTag") | ||
|
||
@Test fun divider_Displayed() { | ||
composeTestRule.setContent { | ||
TUIDivider( | ||
tags = tags, orientation = HORIZONTAL | ||
) | ||
} | ||
composeTestRule.onNodeWithTag(tags.parentTag).assertIsDisplayed() | ||
} | ||
} |
157 changes: 157 additions & 0 deletions
157
tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUIFloatingNavButtonTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
package com.tarkalabs.uicomponents | ||
|
||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.performClick | ||
import com.tarkalabs.tarkaicons.CalendarRtl24 | ||
import com.tarkalabs.tarkaicons.Directions24 | ||
import com.tarkalabs.tarkaicons.Diversity24 | ||
import com.tarkalabs.tarkaicons.Map24 | ||
import com.tarkalabs.tarkaicons.TarkaIcons | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButton | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.Burger | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.List | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.Navigation | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.BURGER | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.LIST | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.VIEW_TOGGLE | ||
import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonTags | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.mockito.kotlin.mock | ||
import org.mockito.kotlin.verify | ||
|
||
class TUIFloatingNavButtonTest { | ||
|
||
@get:Rule val composable = createComposeRule() | ||
private val tags = TUIFloatingNavButtonTags() | ||
|
||
|
||
@Test fun floating_nav_btn_is_displayed() { | ||
val onClick: () -> Unit = mock() | ||
composable.run { | ||
setContent { | ||
TUIFloatingNavButton( | ||
contentType = Navigation(TarkaIcons.Filled.Diversity24, text = "Test"), | ||
onClicked = onClick, tags = tags | ||
) | ||
} | ||
onNodeWithTag(tags.parentTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onClick)() | ||
} | ||
|
||
onNodeWithTag(tags.leadingIconTag, true).assertIsDisplayed() | ||
onNodeWithTag(tags.trailingIconTag, true).assertIsDisplayed() | ||
} | ||
} | ||
|
||
@Test fun floating_nav_btn_trailing_icon_is_not_displayed() { | ||
val onClick: () -> Unit = mock() | ||
composable.run { | ||
setContent { | ||
TUIFloatingNavButton( | ||
contentType = Navigation(TarkaIcons.Filled.Diversity24, text = "Test"), | ||
onClicked = onClick, tags = tags, style = VIEW_TOGGLE | ||
) | ||
} | ||
onNodeWithTag(tags.parentTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onClick)() | ||
} | ||
|
||
onNodeWithTag(tags.leadingIconTag, true).assertIsDisplayed() | ||
onNodeWithTag(tags.trailingIconTag, true).assertDoesNotExist() | ||
} | ||
} | ||
|
||
@Test fun floating_nav_list_type_all_icons_are_displayed() { | ||
val onIconOneClick: () -> Unit = mock() | ||
val onIconTwoClick: () -> Unit = mock() | ||
val onIconThreeClick: () -> Unit = mock() | ||
|
||
composable.run { | ||
setContent { | ||
TUIFloatingNavButton( | ||
contentType = List( | ||
iconOne = TarkaIcons.Filled.CalendarRtl24, | ||
onIconOneClick = onIconOneClick, | ||
iconTwo = TarkaIcons.Filled.Map24, | ||
onIconTwoClick = onIconTwoClick, | ||
iconThree = TarkaIcons.Filled.Directions24, | ||
onIconThreeClick = onIconThreeClick | ||
), | ||
style = LIST | ||
) | ||
} | ||
onNodeWithTag(tags.iconOneTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onIconOneClick)() | ||
} | ||
onNodeWithTag(tags.iconTwoTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onIconTwoClick)() | ||
} | ||
onNodeWithTag(tags.iconThreeTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onIconThreeClick)() | ||
} | ||
} | ||
} | ||
|
||
@Test fun floating_nav_list_type_few_icons_are_displayed() { | ||
val onIconOneClick: () -> Unit = mock() | ||
val onIconTwoClick: () -> Unit = mock() | ||
|
||
composable.run { | ||
setContent { | ||
TUIFloatingNavButton( | ||
contentType = List( | ||
iconOne = TarkaIcons.Filled.CalendarRtl24, | ||
onIconOneClick = onIconOneClick, | ||
iconTwo = TarkaIcons.Filled.Map24, | ||
onIconTwoClick = onIconTwoClick, | ||
), | ||
style = LIST | ||
) | ||
} | ||
onNodeWithTag(tags.iconOneTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onIconOneClick)() | ||
} | ||
onNodeWithTag(tags.iconTwoTag).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onIconTwoClick)() | ||
} | ||
onNodeWithTag(tags.iconThreeTag).run { | ||
assertDoesNotExist() | ||
} | ||
} | ||
} | ||
|
||
@Test fun floating_nav_burger_button_is_displayed() { | ||
val onClick: () -> Unit = mock() | ||
composable.run { | ||
setContent { | ||
TUIFloatingNavButton( | ||
contentType = Burger, | ||
style = BURGER, | ||
onClicked = onClick | ||
) | ||
} | ||
onNodeWithTag(tags.burgerIconTag, true).run { | ||
assertIsDisplayed() | ||
performClick() | ||
verify(onClick)() | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.