-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix Card * 🤖 Updates screenshots --------- Co-authored-by: yschimke <[email protected]>
- Loading branch information
Showing
7 changed files
with
124 additions
and
3 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
109 changes: 109 additions & 0 deletions
109
compose-material/src/test/java/com/google/android/horologist/compose/material/CardTest.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,109 @@ | ||
/* | ||
* Copyright 2022 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.android.horologist.compose.material | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import androidx.wear.compose.material.Text | ||
import com.google.android.horologist.screenshots.rng.WearLegacyComponentTest | ||
import org.junit.Test | ||
|
||
class CardTest : WearLegacyComponentTest() { | ||
|
||
@Test | ||
fun withoutLongClick() { | ||
runComponentTest { | ||
Card( | ||
onClick = { }, | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth(), | ||
) { | ||
Text("Hello, Card") | ||
|
||
androidx.wear.compose.material.Button(onClick = { }) { | ||
Text("Click me!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun withLongClick() { | ||
runComponentTest { | ||
Card( | ||
onClick = { }, | ||
onLongClick = { }, | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth(), | ||
) { | ||
Text("Hello, Card") | ||
|
||
androidx.wear.compose.material.Button(onClick = { }) { | ||
Text("Click me!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun withoutLongClickCustomPadding() { | ||
runComponentTest { | ||
Card( | ||
onClick = { }, | ||
contentPadding = PaddingValues(20.dp), | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth(), | ||
) { | ||
Text("Hello, Card") | ||
|
||
androidx.wear.compose.material.Button(onClick = { }) { | ||
Text("Click me!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun withLongClickCustomPadding() { | ||
runComponentTest { | ||
Card( | ||
onClick = { }, | ||
onLongClick = { }, | ||
contentPadding = PaddingValues(20.dp), | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth(), | ||
) { | ||
Text("Hello, Card") | ||
|
||
androidx.wear.compose.material.Button(onClick = { }) { | ||
Text("Click me!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...images/com.google.android.horologist.compose.material_CardA11yTest_material.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
...mages/com.google.android.horologist.compose.material_CardTest_withLongClick.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
...gle.android.horologist.compose.material_CardTest_withLongClickCustomPadding.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
...es/com.google.android.horologist.compose.material_CardTest_withoutLongClick.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
....android.horologist.compose.material_CardTest_withoutLongClickCustomPadding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.