From b67c1c8e0d06fc9ae57335fab88180cebfc20414 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 28 Sep 2019 23:39:43 -0700 Subject: Remove accessibility text in parser --- .../pitchedapps/frost/facebook/parsers/FbParseTest.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'app/src/test/kotlin') diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt index 11e2502b..0be29c2b 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt @@ -44,11 +44,17 @@ class FbParseTest { private inline fun FrostParser.test(action: T.() -> Unit = {}) = parse(COOKIE).test(url, action) - private inline fun ParseResponse?.test(url: String, action: T.() -> Unit = {}) { + private inline fun ParseResponse?.test( + url: String, + action: T.() -> Unit = {} + ) { val response = this ?: fail("${T::class.simpleName} parser returned null for $url") println(response) - assertFalse(response.data.isEmpty, "${T::class.simpleName} parser returned empty data for $url") + assertFalse( + response.data.isEmpty, + "${T::class.simpleName} parser returned empty data for $url" + ) response.data.action() } @@ -77,5 +83,14 @@ class FbParseTest { assertNotNull(it.img, "img may not be properly matched") } notifs.map(FrostNotif::time).assertDescending("notif time values") + if (notifs.none { it.unread }) { + println("No messages unread.") + } + notifs.forEach { + assertFalse( + it.content.startsWith("unread", ignoreCase = true), + "Parse error; notif starts with 'Unread'" + ) + } } } -- cgit v1.2.3