aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/test/kotlin')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt10
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/FbDomTest.kt26
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbFullImageTest.kt3
3 files changed, 31 insertions, 8 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
index 2be743a3..d730b933 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
@@ -1,7 +1,6 @@
package com.pitchedapps.frost
import com.pitchedapps.frost.facebook.requests.zip
-import com.pitchedapps.frost.injectors.CssHider
import org.junit.Test
import kotlin.test.assertTrue
@@ -19,10 +18,11 @@ class MiscTest {
fun zip() {
val now = System.currentTimeMillis()
val base = 1
- val data = (0..15).map { Math.random() + base }.toTypedArray().zip(
- List<Long>::toLongArray,
- { Thread.sleep((it * 1000).toLong()); System.currentTimeMillis() - now }
- ).blockingGet()
+ val data: LongArray = (0..15).map { Math.random() + base }
+ .toTypedArray().zip(List<Long>::toLongArray) {
+ Thread.sleep((it * 1000).toLong())
+ System.currentTimeMillis() - now
+ }.blockingGet()
println(data.contentToString())
assertTrue(data.all { it >= base * 1000 && it < base * 1000 * 5 },
"zip did not seem to work on different threads")
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbDomTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbDomTest.kt
new file mode 100644
index 00000000..ce748907
--- /dev/null
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbDomTest.kt
@@ -0,0 +1,26 @@
+package com.pitchedapps.frost.facebook
+
+import com.pitchedapps.frost.internal.authDependent
+import com.pitchedapps.frost.internal.testJsoup
+import org.junit.BeforeClass
+import org.junit.Test
+import kotlin.test.assertNotNull
+
+class FbDomTest {
+
+ companion object {
+ @BeforeClass
+ @JvmStatic
+ fun before() {
+ authDependent()
+ }
+ }
+
+ @Test
+ fun checkHeaders() {
+ val doc = testJsoup(FB_URL_BASE)
+ assertNotNull(doc.getElementById("header"))
+ assertNotNull(doc.getElementById("mJewelNav"))
+ }
+
+} \ No newline at end of file
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbFullImageTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbFullImageTest.kt
index 291637c6..c4e51d41 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbFullImageTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbFullImageTest.kt
@@ -1,13 +1,10 @@
package com.pitchedapps.frost.facebook.requests
-import com.pitchedapps.frost.facebook.requests.getFullSizedImage
-import com.pitchedapps.frost.facebook.requests.getFullSizedImageUrl
import com.pitchedapps.frost.internal.COOKIE
import com.pitchedapps.frost.internal.authDependent
import org.junit.BeforeClass
import org.junit.Test
import kotlin.test.assertNotNull
-import kotlin.test.assertTrue
/**
* Created by Allan Wang on 12/04/18.