-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from natura-cosmeticos/shortcut-label-limit
[DSY-1590] Adjusting shortcut label
- Loading branch information
Showing
4 changed files
with
44 additions
and
2 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
40 changes: 40 additions & 0 deletions
40
...androidTest/kotlin/com/natura/android/sample/components/ShortcutActivityFunctionalTest.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,40 @@ | ||
package com.natura.android.sample.components | ||
|
||
import androidx.test.core.app.ActivityScenario | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.google.common.truth.Truth | ||
import kotlinx.android.synthetic.main.activity_shortcut.* | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class ShortcutActivityFunctionalTest { | ||
|
||
private lateinit var scenario: ActivityScenario<ShortcutActivity> | ||
|
||
@Before | ||
fun setUp() { | ||
scenario = ActivityScenario.launch(ShortcutActivity::class.java) | ||
} | ||
|
||
@Test | ||
fun checksEllipsisAtShortcutContainedLabel() { | ||
scenario.onActivity { | ||
val shortcut = it.shortcutContained1 | ||
val ellipsis = shortcut.labelContainer.layout.getEllipsisCount(0) | ||
|
||
Truth.assertThat(ellipsis > 0).isTrue() | ||
} | ||
} | ||
|
||
@Test | ||
fun checksEllipsisAtShortcutOutlinedLabel() { | ||
scenario.onActivity { | ||
val shortcut = it.shortcutOutlined1 | ||
val ellipsis = shortcut.labelContainer.layout.getEllipsisCount(0) | ||
|
||
Truth.assertThat(ellipsis > 0).isTrue() | ||
} | ||
} | ||
} |