aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt2
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRegexTest.kt6
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt11
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt2
4 files changed, 20 insertions, 1 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
index 54792086..a565aa7d 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/MiscTest.kt
@@ -1,6 +1,6 @@
package com.pitchedapps.frost
-import com.pitchedapps.frost.facebook.zip
+import com.pitchedapps.frost.facebook.requests.zip
import com.pitchedapps.frost.injectors.CssHider
import org.junit.Test
import kotlin.test.assertTrue
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRegexTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRegexTest.kt
index da815b34..a79ccf3f 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRegexTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRegexTest.kt
@@ -41,6 +41,12 @@ class FbRegexTest {
assertEquals(id, FB_MESSAGE_NOTIF_ID_MATCHER.find(data)[1]?.toLong(), "thread_fbid mismatch")
val userData = "threadlist_row_other_user_fbid_${id}thread_fbid_"
assertEquals(id, FB_MESSAGE_NOTIF_ID_MATCHER.find(userData)[1]?.toLong(), "user_fbid mismatch")
+ }
+ @Test
+ fun jsonUrlRegex() {
+ val url = "https://www.hello.world"
+ val data = "\"uri\":\"$url\"}"
+ assertEquals(url, FB_JSON_URL_MATCHER.find(data)[1])
}
} \ No newline at end of file
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt
index c3b19727..93f09fc6 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt
@@ -1,5 +1,8 @@
package com.pitchedapps.frost.facebook
+import com.pitchedapps.frost.facebook.requests.getAuth
+import com.pitchedapps.frost.facebook.requests.getFullSizedImage
+import com.pitchedapps.frost.facebook.requests.markNotificationRead
import com.pitchedapps.frost.internal.AUTH
import com.pitchedapps.frost.internal.COOKIE
import com.pitchedapps.frost.internal.USER_ID
@@ -48,4 +51,12 @@ class FbRequestTest {
AUTH.markNotificationRead(notifId).call.assertNoError()
}
+ @Test
+ fun fullSizeImage() {
+ val fbid = 10155966932992838L // google's current cover photo
+ val url = AUTH.getFullSizedImage(fbid).invoke()
+ println(url)
+ assertTrue(url?.startsWith("https://scontent") == true)
+ }
+
} \ No newline at end of file
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 ed88453a..fb2b2a45 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/internal/Internal.kt
@@ -1,6 +1,8 @@
package com.pitchedapps.frost.internal
import com.pitchedapps.frost.facebook.*
+import com.pitchedapps.frost.facebook.requests.RequestAuth
+import com.pitchedapps.frost.facebook.requests.getAuth
import com.pitchedapps.frost.utils.frostJsoup
import org.junit.Assume
import java.io.File