-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…h-Bar GT-2283 Make the Language Filter SearchBar sticky
- Loading branch information
Showing
14 changed files
with
237 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
3 changes: 3 additions & 0 deletions
3
...parazziTest_LanguageFilter - Button - English Selected[NIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...azziTest_LanguageFilter - Button - English Selected[NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...azziTest_LanguageFilter - Button - English Selected[NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...iTest_LanguageFilter - Button - English Selected[NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...zziTest_LanguageFilter - Button - No Language Selected[NIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...Test_LanguageFilter - Button - No Language Selected[NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...Test_LanguageFilter - Button - No Language Selected[NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...t_LanguageFilter - Button - No Language Selected[NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions
57
app/src/testDebug/kotlin/org/cru/godtools/ui/dashboard/tools/ToolFiltersPaparazziTest.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,57 @@ | ||
package org.cru.godtools.ui.dashboard.tools | ||
|
||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.ui.Modifier | ||
import com.android.resources.NightMode | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import java.util.Locale | ||
import kotlin.test.Ignore | ||
import kotlin.test.Test | ||
import org.cru.godtools.model.Language | ||
import org.cru.godtools.ui.BasePaparazziTest | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(TestParameterInjector::class) | ||
class ToolFiltersPaparazziTest( | ||
@TestParameter nightMode: NightMode, | ||
@TestParameter accessibilityMode: AccessibilityMode, | ||
) : BasePaparazziTest(nightMode = nightMode, accessibilityMode = accessibilityMode) { | ||
@Test | ||
fun `LanguageFilter - Button - No Language Selected`() = renderLanguageFilter( | ||
ToolsScreen.Filters( | ||
selectedLanguage = null, | ||
showLanguagesMenu = false, | ||
) | ||
) | ||
|
||
@Test | ||
fun `LanguageFilter - Button - English Selected`() = renderLanguageFilter( | ||
ToolsScreen.Filters( | ||
selectedLanguage = Language(Locale.ENGLISH), | ||
showLanguagesMenu = false, | ||
) | ||
) | ||
|
||
// TODO: It appears that LayoutLib does not correctly support Popups/Windows currently | ||
// see: https://issuetracker.google.com/issues/317792376 | ||
// see: https://issuetracker.google.com/issues/308808808 | ||
// see: https://issuetracker.google.com/issues/321623569 | ||
@Test | ||
@Ignore("Ignored for now due to LayoutLib rendering issues") | ||
fun `LanguageFilter - Dropdown Menu`() = renderLanguageFilter( | ||
ToolsScreen.Filters( | ||
selectedLanguage = Language(Locale.ENGLISH), | ||
showLanguagesMenu = true, | ||
languages = listOf( | ||
ToolsScreen.Filters.Filter(Language(Locale.ENGLISH), 12345), | ||
ToolsScreen.Filters.Filter(Language(Locale.FRENCH), 1), | ||
ToolsScreen.Filters.Filter(Language(Locale("es")), 3), | ||
), | ||
) | ||
) | ||
|
||
private fun renderLanguageFilter(filters: ToolsScreen.Filters) = centerInSnapshot { | ||
LanguageFilter(filters, modifier = Modifier.fillMaxWidth(0.5f)) | ||
} | ||
} |
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
Oops, something went wrong.