aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-tl-tests.el
diff options
context:
space:
mode:
authorAlexander Griffith <griffitaj@gmail.com>2018-03-08 10:33:02 -0500
committerJohnson Denen <johnson.denen@gmail.com>2018-08-10 22:20:04 -0400
commit45b2a2d5821d27468d32d8fb920de218fb503f46 (patch)
treecf9395d33d0a7d71b7064184cbf8898085b90d38 /test/mastodon-tl-tests.el
parent5de5012d01de70a2ebed496a90daa60e9b1a8481 (diff)
Generalizations for notifications (#174)
* Added generalizations needed for adding notifications #37 - Made generalizations to toot and bylines to enable notifications. - Fixed tl tests to account for the new function arguments. - fixed whitespace
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r--test/mastodon-tl-tests.el43
1 files changed, 33 insertions, 10 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index 6e75d26..04f00e5 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -257,7 +257,9 @@ a string or a numeric."
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
(should (string= (substring-no-properties
- (mastodon-tl--byline mastodon-tl-test-base-toot))
+ (mastodon-tl--byline mastodon-tl-test-base-toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| Account 42 (@acct42@example.space) 2999-99-99 00:11:22
------------")))))
@@ -272,7 +274,9 @@ a string or a numeric."
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
(should (string= (substring-no-properties
- (mastodon-tl--byline mastodon-tl-test-base-toot))
+ (mastodon-tl--byline mastodon-tl-test-base-toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| Account 42 (@acct42@example.space) 2999-99-99 00:11:22
------------")))))
@@ -286,7 +290,10 @@ a string or a numeric."
(mock (date-to-time timestamp) => '(22782 21551))
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| (B) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
------------")))))
@@ -300,7 +307,10 @@ a string or a numeric."
(mock (date-to-time timestamp) => '(22782 21551))
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| (F) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
------------")))))
@@ -315,7 +325,10 @@ a string or a numeric."
(mock (date-to-time timestamp) => '(22782 21551))
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| (B) (F) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
------------")))))
@@ -335,7 +348,10 @@ a string or a numeric."
(mock (date-to-time original-timestamp) => '(3 4))
(mock (format-time-string mastodon-toot-timestamp-format '(3 4)) => "original time")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| Account 42 (@acct42@example.space) Boosted Account 43 (@acct43@example.space) original time
------------")))))
@@ -356,8 +372,10 @@ a string or a numeric."
(mock (date-to-time original-timestamp) => '(3 4))
(mock (format-time-string mastodon-toot-timestamp-format '(3 4)) => "original time")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
- "
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))"
| Account 42 (@acct42@example.space) Boosted Account 43 (@acct43@example.space) original time
------------")))))
@@ -376,7 +394,10 @@ a string or a numeric."
(mock (date-to-time original-timestamp) => '(3 4))
(mock (format-time-string mastodon-toot-timestamp-format '(3 4)) => "original time")
- (should (string= (substring-no-properties (mastodon-tl--byline toot))
+ (should (string= (substring-no-properties
+ (mastodon-tl--byline toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
"
| (B) (F) Account 42 (@acct42@example.space) Boosted Account 43 (@acct43@example.space) original time
------------")))))
@@ -390,7 +411,9 @@ a string or a numeric."
(mock (current-time) => '(22782 22000))
(mock (format-time-string mastodon-toot-timestamp-format '(22782 21551)) => "2999-99-99 00:11:22")
- (let* ((formatted-string (mastodon-tl--byline mastodon-tl-test-base-toot))
+ (let* ((formatted-string (mastodon-tl--byline mastodon-tl-test-base-toot
+ 'mastodon-tl--byline-author
+ 'mastodon-tl--byline-boosted))
(timestamp-start (string-match "2999-99-99" formatted-string))
(properties (text-properties-at timestamp-start formatted-string)))
(should (equal '(22782 21551) (plist-get properties 'timestamp)))