aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/notice-controller-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/app/controllers/notice-controller-test.js')
-rw-r--r--test/unit/app/controllers/notice-controller-test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/app/controllers/notice-controller-test.js b/test/unit/app/controllers/notice-controller-test.js
index 834c88f7b..caa50a03e 100644
--- a/test/unit/app/controllers/notice-controller-test.js
+++ b/test/unit/app/controllers/notice-controller-test.js
@@ -39,6 +39,31 @@ describe('notice-controller', function () {
})
})
+ describe('#markAllNoticesRead', () => {
+ it('marks all notices read', async () => {
+ const testList = [{
+ id: 0,
+ read: false,
+ title: 'Notice 1',
+ }, {
+ id: 1,
+ read: false,
+ title: 'Notice 2',
+ }, {
+ id: 2,
+ read: false,
+ title: 'Notice 3',
+ }]
+
+ noticeController.setNoticesList(testList)
+
+ noticeController.markAllNoticesRead()
+
+ const unreadNotices = noticeController.getUnreadNotices()
+ assert.equal(unreadNotices.length, 0)
+ })
+ })
+
describe('#getNextUnreadNotice', function () {
it('should retrieve the latest unread notice', function (done) {
var testList = [