Skip to content

Commit

Permalink
Update OudsButton according to design specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre committed Nov 28, 2024
1 parent 0e1b5b0 commit ce2ee68
Show file tree
Hide file tree
Showing 43 changed files with 1,063 additions and 109 deletions.
2 changes: 2 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png
app/src/prod/res/drawable/ic_launcher_background.xml
app/src/prod/res/drawable/ic_launcher_foreground.xml

core/src/main/res/drawable/loading_indicator_circular.xml

docs/images/favicon-16x16.png
docs/images/orange-logo.svg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,35 @@

package com.orange.ouds.core.component.button

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import com.orange.ouds.core.extension.setOudsContent
import org.junit.Rule
import org.junit.Test
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify

internal class OudsButtonTest {

@get:Rule
val composeTestRule = createComposeRule()

@Test
fun oudsButtonRendersAsExpected() {
fun oudsButtonClickSucceeds() {
with(composeTestRule) {
val text = "Click"
val onClick = {}
val text = "Text"
val onClick = mock<() -> Unit>()

setOudsContent {
OudsButton(
text = text,
onClick = onClick,
onClick = onClick
)
}

onNodeWithText(text).assertIsDisplayed()
onNodeWithText(text).performClick()
verify(onClick).invoke()
}
}
}
Loading

0 comments on commit ce2ee68

Please sign in to comment.