-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Rework UI of settings wear favorite screen to use Material3 #7311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aishsidya0402-netizen
wants to merge
5
commits into
home-assistant:main
Choose a base branch
from
aishsidya0402-netizen:fix-issue-6300
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+90
−32
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8ad3402
Migrate SettingsWearTopAppBar to Material3 HATopBar
aishsidya0402-netizen cdf9dca
Add unit tests for SettingsWearTopAppBar HATopBar migration
aishsidya0402-netizen ca0874d
Remove duplicate gradle.tooling.parallel entry
aishsidya0402-netizen 7b3fd72
Remove IDE-specific markdown settings file
aishsidya0402-netizen 04d8c9f
Move SettingsWearTopAppBarTest to app/testFull to match production mo…
aishsidya0402-netizen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
80 changes: 80 additions & 0 deletions
80
...otlin/io/homeassistant/companion/android/settings/wear/views/SettingsWearTopAppBarTest.kt
This file contains hidden or 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,80 @@ | ||
| package io.homeassistant.companion.android.settings.wear.views | ||
|
|
||
| import androidx.compose.material3.Text | ||
| import androidx.compose.ui.test.junit4.createComposeRule | ||
| import androidx.compose.ui.test.onNodeWithContentDescription | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import androidx.compose.ui.test.performClick | ||
| import io.homeassistant.companion.android.util.compose.HomeAssistantAppTheme | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
|
|
||
| class SettingsWearTopAppBarTest { | ||
|
|
||
| @get:Rule | ||
| val composeTestRule = createComposeRule() | ||
|
|
||
| @Test | ||
| fun `Given a wear settings screen when it renders without a docs link then no help icon is shown`() { | ||
| composeTestRule.setContent { | ||
| HomeAssistantAppTheme { | ||
| SettingsWearTopAppBar( | ||
| title = { Text("Favorites") }, | ||
| onBackClicked = {}, | ||
| docsLink = null, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithContentDescription("Get help").assertDoesNotExist() | ||
| } | ||
|
|
||
| @Test | ||
| fun `Given a wear settings screen when it renders with a docs link then a help icon is shown`() { | ||
| composeTestRule.setContent { | ||
| HomeAssistantAppTheme { | ||
| SettingsWearTopAppBar( | ||
| title = { Text("Favorites") }, | ||
| onBackClicked = {}, | ||
| docsLink = WEAR_DOCS_LINK, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithContentDescription("Get help").assertExists() | ||
| } | ||
|
|
||
| @Test | ||
| fun `Given a wear settings screen when the back icon is tapped then onBackClicked is invoked`() { | ||
| var backClicked = false | ||
|
|
||
| composeTestRule.setContent { | ||
| HomeAssistantAppTheme { | ||
| SettingsWearTopAppBar( | ||
| title = { Text("Favorites") }, | ||
| onBackClicked = { backClicked = true }, | ||
| docsLink = null, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithContentDescription("Navigate up").performClick() | ||
|
|
||
| assert(backClicked) { "Expected onBackClicked to be invoked after tapping the back icon" } | ||
| } | ||
|
|
||
| @Test | ||
| fun `Given a wear settings screen when it renders then the title is displayed`() { | ||
| composeTestRule.setContent { | ||
| HomeAssistantAppTheme { | ||
| SettingsWearTopAppBar( | ||
| title = { Text("Favorites") }, | ||
| onBackClicked = {}, | ||
| docsLink = null, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithText("Favorites").assertExists() | ||
| } | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -37,3 +37,4 @@ android.experimental.enableScreenshotTest=true | |
|
|
||
| # Uncomment to disable Strict Mode | ||
| #noStrictMode=true | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.