diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-31 00:42:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-31 00:42:49 -0500 |
commit | 3076d9a97c203497aec1415d8ac6037d10eebb46 (patch) | |
tree | cdeb914fa95f2b230f6327be3e1527d15b41dc94 /app/src/test | |
parent | 041bafcceadbd5203e95f2692899ac903dd2e883 (diff) | |
download | frost-3076d9a97c203497aec1415d8ac6037d10eebb46.tar.gz frost-3076d9a97c203497aec1415d8ac6037d10eebb46.tar.bz2 frost-3076d9a97c203497aec1415d8ac6037d10eebb46.zip |
feature/menu-parser (#582)
* Test menu parser
* Add menu fragment implementation
* Test proguard
* Clean up
* Use async
* Use invoke
* Try without proguard
* Try 2
* Add fallback logic
* Use normal notification event
* Add custom event flag
* Add rest of menu fragment data
* Ensure fallback works
* Update docs
Diffstat (limited to 'app/src/test')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt | 13 |
1 files changed, 12 insertions, 1 deletions
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 93f09fc6..9f44779f 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt @@ -1,7 +1,9 @@ package com.pitchedapps.frost.facebook +import com.fasterxml.jackson.databind.ObjectMapper import com.pitchedapps.frost.facebook.requests.getAuth import com.pitchedapps.frost.facebook.requests.getFullSizedImage +import com.pitchedapps.frost.facebook.requests.getMenuData import com.pitchedapps.frost.facebook.requests.markNotificationRead import com.pitchedapps.frost.internal.AUTH import com.pitchedapps.frost.internal.COOKIE @@ -59,4 +61,13 @@ class FbRequestTest { assertTrue(url?.startsWith("https://scontent") == true) } -}
\ No newline at end of file + @Test + fun testMenu() { + val data = AUTH.getMenuData().invoke() + assertNotNull(data) + println(ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(data!!)) + assertTrue(data.footer.hasContent, "Footer may be badly parsed") + val items = data.flatMapValid() + assertTrue(items.size > 15, "Something may be badly parsed") + } +} |