Skip to content

Commit

Permalink
chore: more ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zizouet committed Jun 2, 2024
1 parent 78d91ab commit 9c775c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
26 changes: 11 additions & 15 deletions app/src/androidTest/java/com/github/se/assocify/ThemeTest.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.github.se.assocify

import android.content.Context
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertTextContains
import androidx.compose.ui.test.junit4.createComposeRule
Expand Down Expand Up @@ -63,17 +60,16 @@ class ThemeTest : TestCase(kaspressoBuilder = Kaspresso.Builder.withComposeSuppo
}
}

@Test
fun systemTheme() {
composeTestRule.setContent {
AssocifyTheme(theme = Theme.SYSTEM, dynamicColor = false) { TestScreen() }
}
with(composeTestRule) {
onNodeWithText("Test")
.assertIsDisplayed()
.onSibling()
.assertTextContains(md_theme_light_primary.toString())
}
@Test
fun systemTheme() {
composeTestRule.setContent {
AssocifyTheme(theme = Theme.SYSTEM, dynamicColor = false) { TestScreen() }
}

with(composeTestRule) {
onNodeWithText("Test")
.assertIsDisplayed()
.onSibling()
.assertTextContains(md_theme_light_primary.toString())
}
}
}
22 changes: 11 additions & 11 deletions app/src/test/java/com/github/se/assocify/ThemeViewModelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import org.junit.Test

class ThemeViewModelTest {

@Test
fun testSetTheme() {
val themeVM = ThemeViewModel()
themeVM.setTheme(Theme.DARK)
assert(themeVM.theme.value == Theme.DARK)
themeVM.setTheme(Theme.LIGHT)
assert(themeVM.theme.value == Theme.LIGHT)
themeVM.setTheme(Theme.SYSTEM)
assert(themeVM.theme.value == Theme.SYSTEM)
}
}
@Test
fun testSetTheme() {
val themeVM = ThemeViewModel()
themeVM.setTheme(Theme.DARK)
assert(themeVM.theme.value == Theme.DARK)
themeVM.setTheme(Theme.LIGHT)
assert(themeVM.theme.value == Theme.LIGHT)
themeVM.setTheme(Theme.SYSTEM)
assert(themeVM.theme.value == Theme.SYSTEM)
}
}

0 comments on commit 9c775c8

Please sign in to comment.