From 3076d9a97c203497aec1415d8ac6037d10eebb46 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 31 Dec 2017 00:42:49 -0500 Subject: 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 --- .../kotlin/com/pitchedapps/frost/facebook/FbRequestTest.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'app/src/test/kotlin') 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") + } +} -- cgit v1.2.3