aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-notifications-test.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-12-17 14:26:03 +0100
committermousebot <mousebot@riseup.net>2021-12-17 14:26:03 +0100
commitbb9e8ab828cf249ce8fd23a47fe4e75ee9ab61c7 (patch)
tree76be863aeb318606a195a5fe913fd6c15f825ab7 /test/mastodon-notifications-test.el
parent2d8337af15b2b0c988df13cea4cb31c944b21aac (diff)
parentc65c6231f29929b6e39ebcc9b866d492519ae19b (diff)
Merge branch 'develop'
Diffstat (limited to 'test/mastodon-notifications-test.el')
-rw-r--r--test/mastodon-notifications-test.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/mastodon-notifications-test.el b/test/mastodon-notifications-test.el
index 19b591d..4804e10 100644
--- a/test/mastodon-notifications-test.el
+++ b/test/mastodon-notifications-test.el
@@ -1,8 +1,10 @@
+;;; mastodon-notifications-test.el --- Tests for mastodon-notifications.el -*- lexical-binding: nil -*-
+
(require 'cl-lib)
(require 'cl-macs)
(require 'el-mock)
-(defconst mastodon-notifications-test-base-mentioned
+(defconst mastodon-notifications--test-base-mentioned
'((id . "1234")
(type . "mention")
(created_at . "2018-03-06T04:27:21.288Z" )
@@ -43,7 +45,7 @@
(favourites_count . 0)
(reblog))))
-(defconst mastodon-notifications-test-base-favourite
+(defconst mastodon-notifications--test-base-favourite
'((id . "1234")
(type . "favourite")
(created_at . "2018-03-06T04:27:21.288Z" )
@@ -84,7 +86,7 @@
(favourites_count . 0)
(reblog))))
-(defconst mastodon-notifications-test-base-boosted
+(defconst mastodon-notifications--test-base-boosted
'((id . "1234")
(type . "reblog")
(created_at . "2018-03-06T04:27:21.288Z" )
@@ -125,7 +127,7 @@
(favourites_count . 0)
(reblog))))
-(defconst mastodon-notifications-test-base-followed
+(defconst mastodon-notifications--test-base-followed
'((id . "1234")
(type . "follow")
(created_at . "2018-03-06T04:27:21.288Z" )
@@ -166,7 +168,7 @@
(favourites_count . 0)
(reblog))))
-(defconst mastodon-notifications-test-base-favourite
+(defconst mastodon-notifications--test-base-favourite
'((id . "1234")
(type . "mention")
(created_at . "2018-03-06T04:27:21.288Z" )
@@ -181,11 +183,11 @@
(statuses_count . 101)
(note . "E"))))
-(ert-deftest notification-get ()
+(ert-deftest mastodon-notifications--notification-get ()
"Ensure get request format for notifictions is accurate."
(let ((mastodon-instance-url "https://instance.url"))
(with-mock
- (mock (mastodon-http--get-json-async "https://instance.url/api/v1/notifications" 'mastodon-tl--init* "*mastodon-notifications*" "notifications" 'mastodon-notifications--timeline))
+ (mock (mastodon-http--get-json "https://instance.url/api/v1/notifications" ))
(mastodon-notifications--get))))
(defun mastodon-notifications--test-type (fun sample)
@@ -208,6 +210,8 @@ notification to be tested."
(string= " Favourited your status from"
(mastodon-notifications--byline-concat "Favourited"))
(string= " Boosted your status from"
- (mastodon-notifications--byline-concat "Boosted")))))
+ (mastodon-notifications--byline-concat "Boosted"))
+ (string= " Posted a post"
+ (mastodon-notifications--byline-concat "Posted")))))