You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
equal(notificationsDropdown().find("li").length,3,"when user opens notifications dropdown for the second time, notifications are reloaded afresh");
110
-
equal(Discourse.User.current().get("unread_notifications"),0,"when user opens notifications dropdown for the second time, current user's notification count is zeroed again");
111
-
});
112
-
});
113
-
114
-
test("notifications: when there are no notifications",function(){
115
-
expect(3);
116
-
117
-
Discourse.URL_FIXTURES["/notifications"]=[];
118
-
119
-
visit("/")
60
+
.then(function(){
61
+
ok(!exists($(itemSelector)),"initially is empty");
62
+
})
120
63
.click("#user-notifications")
121
64
.then(function(){
122
-
equal(notificationsDropdown().find("ul").length,0,"a list of notifications is not displayed");
123
-
equal(notificationsDropdown().find("div.none").length,1,"special 'no notifications' message is displayed");
equal(notificationsDropdown().find("li").length,4,"dropdown contains list items for all notifications plus for additional 'more' link");
140
-
141
-
equal(notificationsDropdown().find("li").eq(0).attr("class"),"","list item for unread notification has no class");
142
-
equal(notificationsDropdown().find("li").eq(0).html(),'notifications.mentioned velesin <a href="/t/some-topic-title/1234">Some topic title</a>',"notification with a slug and for the first post in a topic is rendered correctly");
143
-
144
-
equal(notificationsDropdown().find("li").eq(1).attr("class"),"read","list item for read notification has correct class");
145
-
equal(notificationsDropdown().find("li").eq(1).html(),'notifications.replied velesin <a href="/t/topic/1234/2">Some topic title</a>',"notification without a slug and for a non-first post in a topic is rendered correctly");
146
-
147
-
equal(notificationsDropdown().find("li").eq(2).html(),'notifications.liked velesin',"notification without topic title is rendered correctly");
148
-
149
-
equal(notificationsDropdown().find("li").eq(3).attr("class"),"read last","list item for 'more' link has correct class");
150
-
equal(notificationsDropdown().find("li").eq(3).find("a").attr("href"),Discourse.User.current().get("path"),"'more' link points to a correct URL");
151
-
equal(notificationsDropdown().find("li").eq(3).find("a").text(),"notifications.more"+" …","'more' link has correct text");
0 commit comments