From 306b46bf6c47b6ce16805bf1808a123cf75f7c25 Mon Sep 17 00:00:00 2001 From: Paul Kraft Date: Mon, 11 Nov 2024 13:46:54 -0800 Subject: [PATCH] Rename test --- ...ionTest.kt => FocusValidationRulesTest.kt} | 4 +- .../composables/DefaultValidationRules.kt | 38 ------------------- 2 files changed, 2 insertions(+), 40 deletions(-) rename core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/{ValidationTest.kt => FocusValidationRulesTest.kt} (93%) delete mode 100644 core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/composables/DefaultValidationRules.kt diff --git a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/ValidationTest.kt b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/FocusValidationRulesTest.kt similarity index 93% rename from core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/ValidationTest.kt rename to core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/FocusValidationRulesTest.kt index 340a5d73..3466f8c2 100644 --- a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/ValidationTest.kt +++ b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/FocusValidationRulesTest.kt @@ -7,7 +7,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test -class ValidationTest { +class FocusValidationRulesTest { @get:Rule val composeTestRule = createComposeRule() @@ -20,7 +20,7 @@ class ValidationTest { } @Test - fun testValidationWithFocus() { + fun testFocusValidationRules() { focusValidationRules { assertHasEngines(true) assertInputValid(false) diff --git a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/composables/DefaultValidationRules.kt b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/composables/DefaultValidationRules.kt deleted file mode 100644 index 55b0bb61..00000000 --- a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/validation/composables/DefaultValidationRules.kt +++ /dev/null @@ -1,38 +0,0 @@ -package edu.stanford.spezi.core.design.validation.composables - -import androidx.compose.runtime.Composable -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import edu.stanford.spezi.core.design.component.StringResource -import edu.stanford.spezi.core.design.validation.validation.Validate -import edu.stanford.spezi.core.design.validation.validation.ValidationRule -import edu.stanford.spezi.core.design.validation.validation.asciiLettersOnly -import edu.stanford.spezi.core.design.validation.validation.mediumPassword -import edu.stanford.spezi.core.design.validation.validation.minimalEmail -import edu.stanford.spezi.core.design.validation.validation.minimalPassword -import edu.stanford.spezi.core.design.validation.validation.nonEmpty -import edu.stanford.spezi.core.design.validation.validation.strongPassword -import edu.stanford.spezi.core.design.validation.validation.unicodeLettersOnly -import edu.stanford.spezi.core.design.validation.validation.views.VerifiableTextField - -@Composable -fun DefaultValidationRules() { - val input = remember { mutableStateOf("") } - val rules = remember { - listOf( - ValidationRule.nonEmpty, - ValidationRule.unicodeLettersOnly, - ValidationRule.asciiLettersOnly, - ValidationRule.minimalEmail, - ValidationRule.minimalPassword, - ValidationRule.mediumPassword, - ValidationRule.strongPassword - ) - } - Validate(input.value, rules) { - VerifiableTextField( - StringResource("Field"), - text = input - ) - } -}