aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/notice-controller-test.js
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-04-02 09:03:54 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-04-02 09:03:54 +0800
commita46ec83c9b258a3aed65e1ef08769300c01ca13b (patch)
treea48f7ddb8635ffbb024ff755d1865686c8a0ab27 /test/unit/app/controllers/notice-controller-test.js
parent4055dc3475cb743e540766a8a8c704bb2b807502 (diff)
downloadtangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.gz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.bz2
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.lz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.xz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.zst
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.zip
Remove NoticeController (#6382)
Diffstat (limited to 'test/unit/app/controllers/notice-controller-test.js')
-rw-r--r--test/unit/app/controllers/notice-controller-test.js92
1 files changed, 0 insertions, 92 deletions
diff --git a/test/unit/app/controllers/notice-controller-test.js b/test/unit/app/controllers/notice-controller-test.js
deleted file mode 100644
index caa50a03e..000000000
--- a/test/unit/app/controllers/notice-controller-test.js
+++ /dev/null
@@ -1,92 +0,0 @@
-const assert = require('assert')
-const NoticeController = require('../../../../app/scripts/notice-controller')
-
-describe('notice-controller', function () {
- var noticeController
-
- beforeEach(function () {
- noticeController = new NoticeController()
- })
-
- describe('notices', function () {
-
- describe('#setNoticesList', function () {
- it('should set data appropriately', function (done) {
- var testList = [{
- id: 0,
- read: false,
- title: 'Futuristic Notice',
- }]
- noticeController.setNoticesList(testList)
- var testListId = noticeController.getNoticesList()[0].id
- assert.equal(testListId, 0)
- done()
- })
- })
-
- describe('#markNoticeRead', function () {
- it('should mark a notice as read', function (done) {
- var testList = [{
- id: 0,
- read: false,
- title: 'Futuristic Notice',
- }]
- noticeController.setNoticesList(testList)
- noticeController.markNoticeRead(testList[0])
- var newList = noticeController.getNoticesList()
- assert.ok(newList[0].read)
- done()
- })
- })
-
- 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 = [
- {id: 0, read: true, title: 'Past Notice'},
- {id: 1, read: false, title: 'Current Notice'},
- {id: 2, read: false, title: 'Future Notice'},
- ]
- noticeController.setNoticesList(testList)
- var latestUnread = noticeController.getNextUnreadNotice()
- assert.equal(latestUnread.id, 1)
- done()
- })
- it('should return undefined if no unread notices exist.', function (done) {
- var testList = [
- {id: 0, read: true, title: 'Past Notice'},
- {id: 1, read: true, title: 'Current Notice'},
- {id: 2, read: true, title: 'Future Notice'},
- ]
- noticeController.setNoticesList(testList)
- var latestUnread = noticeController.getNextUnreadNotice()
- assert.ok(!latestUnread)
- done()
- })
- })
- })
-})