aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin/com/pitchedapps
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-09-28 00:14:56 -0400
committerGitHub <noreply@github.com>2018-09-28 00:14:56 -0400
commitf23791494030ce11c819e240ee627d6553e3d6d3 (patch)
tree31707f8684ad89d74aed1ba91520d066b2b98201 /app/src/test/kotlin/com/pitchedapps
parente10786003ecf16472c72b76eca100028b39634f2 (diff)
parent0d23df5fe082754f3579eb2b6e91c7fcfb1134b0 (diff)
downloadfrost-f23791494030ce11c819e240ee627d6553e3d6d3.tar.gz
frost-f23791494030ce11c819e240ee627d6553e3d6d3.tar.bz2
frost-f23791494030ce11c819e240ee627d6553e3d6d3.zip
Merge pull request #1110 from AllanWang/fix/misc
Fix/misc
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps')
-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.