From b8ab09e645333a76aee19637bda3c4e76f51f5e1 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 25 Apr 2019 15:43:38 -0700 Subject: Update some tests --- .../kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt | 2 ++ app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src/test') diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt index 4fe43ca8..11e2502b 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt @@ -21,6 +21,7 @@ import com.pitchedapps.frost.internal.assertComponentsNotEmpty import com.pitchedapps.frost.internal.assertDescending import com.pitchedapps.frost.internal.authDependent import org.junit.BeforeClass +import org.junit.Ignore import org.junit.Test import kotlin.test.assertFalse import kotlin.test.assertNotNull @@ -64,6 +65,7 @@ class FbParseTest { @Test fun messageUser() = MessageParser.queryUser(COOKIE, "allan").test("allan query") + @Ignore("No longer works as search results don't appear in html") @Test fun search() = SearchParser.test() diff --git a/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt b/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt index b8d9635a..41473e86 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt @@ -59,7 +59,7 @@ val AUTH: RequestAuth by lazy { } } -val VALID_COOKIE: Boolean by lazy { +private val VALID_COOKIE: Boolean by lazy { val data = testJsoup(FbItem.SETTINGS.url) data.title() == "Settings" } @@ -68,7 +68,8 @@ fun testJsoup(url: String) = frostJsoup(COOKIE, url) fun authDependent() { println("Auth Dependent") - Assume.assumeTrue(COOKIE.isNotEmpty() && VALID_COOKIE) + Assume.assumeTrue("Cookie cannot be empty", COOKIE.isNotEmpty()) + Assume.assumeTrue("Cookie is not valid", VALID_COOKIE) } /** -- cgit v1.2.3