diff --git a/app/src/androidTest/java/com/github/se/assocify/ThemeTest.kt b/app/src/androidTest/java/com/github/se/assocify/ThemeTest.kt index e277375a5..c573eefaa 100644 --- a/app/src/androidTest/java/com/github/se/assocify/ThemeTest.kt +++ b/app/src/androidTest/java/com/github/se/assocify/ThemeTest.kt @@ -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 @@ -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()) + } + } } diff --git a/app/src/test/java/com/github/se/assocify/ThemeViewModelTest.kt b/app/src/test/java/com/github/se/assocify/ThemeViewModelTest.kt index 11dafb8af..5a11b9841 100644 --- a/app/src/test/java/com/github/se/assocify/ThemeViewModelTest.kt +++ b/app/src/test/java/com/github/se/assocify/ThemeViewModelTest.kt @@ -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) - } -} \ No newline at end of file + @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) + } +}