diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-28 23:53:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-28 23:53:14 -0700 |
commit | f5ae18fc0d824dbdce5523128f9ded86bdfa6d08 (patch) | |
tree | cabaef0452a65671c42806588b5e789b89bb01e4 /app/src/test/kotlin | |
parent | 08a0bbe6e921f411e04a13c4fdc1282cf9fb4221 (diff) | |
parent | b67c1c8e0d06fc9ae57335fab88180cebfc20414 (diff) | |
download | frost-f5ae18fc0d824dbdce5523128f9ded86bdfa6d08.tar.gz frost-f5ae18fc0d824dbdce5523128f9ded86bdfa6d08.tar.bz2 frost-f5ae18fc0d824dbdce5523128f9ded86bdfa6d08.zip |
Merge pull request #1560 from AllanWang/fix-notif-parse
Remove accessibility text in notif parser
Diffstat (limited to 'app/src/test/kotlin')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt | 19 |
1 files changed, 17 insertions, 2 deletions
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 <reified T : ParseData> FrostParser<T>.test(action: T.() -> Unit = {}) = parse(COOKIE).test(url, action) - private inline fun <reified T : ParseData> ParseResponse<T>?.test(url: String, action: T.() -> Unit = {}) { + private inline fun <reified T : ParseData> ParseResponse<T>?.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'" + ) + } } } |