aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/notice-controller-test.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-06-15 01:11:35 +0800
committerGitHub <noreply@github.com>2018-06-15 01:11:35 +0800
commitd9ef72cb7ef78a1c2bf7ce119352425d72a10dc0 (patch)
tree6c14bb94e21996bdf688cc08011c8955322697ad /test/unit/app/controllers/notice-controller-test.js
parent11bfdf444dca3917479cff82f807cc0d4c217191 (diff)
parentd814bee578bfe931766804612ed57a545e4b21a8 (diff)
downloadtangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar.gz
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar.bz2
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar.lz
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar.xz
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.tar.zst
tangerine-wallet-browser-d9ef72cb7ef78a1c2bf7ce119352425d72a10dc0.zip
Merge branch 'develop' into save-brave
Diffstat (limited to 'test/unit/app/controllers/notice-controller-test.js')
-rw-r--r--test/unit/app/controllers/notice-controller-test.js50
1 files changed, 4 insertions, 46 deletions
diff --git a/test/unit/app/controllers/notice-controller-test.js b/test/unit/app/controllers/notice-controller-test.js
index e78b69623..b3ae75080 100644
--- a/test/unit/app/controllers/notice-controller-test.js
+++ b/test/unit/app/controllers/notice-controller-test.js
@@ -14,18 +14,6 @@ describe('notice-controller', function () {
})
describe('notices', function () {
- describe('#getNoticesList', function () {
- it('should return an empty array when new', function (done) {
- // const testList = [{
- // id: 0,
- // read: false,
- // title: 'Futuristic Notice',
- // }]
- var result = noticeController.getNoticesList()
- assert.equal(result.length, 0)
- done()
- })
- })
describe('#setNoticesList', function () {
it('should set data appropriately', function (done) {
@@ -41,36 +29,6 @@ describe('notice-controller', function () {
})
})
- describe('#updateNoticeslist', function () {
- it('should integrate the latest changes from the source', function (done) {
- var testList = [{
- id: 55,
- read: false,
- title: 'Futuristic Notice',
- }]
- noticeController.setNoticesList(testList)
- noticeController.updateNoticesList().then(() => {
- var newList = noticeController.getNoticesList()
- assert.ok(newList[0].id === 55)
- assert.ok(newList[1])
- done()
- })
- })
- it('should not overwrite any existing fields', function (done) {
- var testList = [{
- id: 0,
- read: false,
- title: 'Futuristic Notice',
- }]
- noticeController.setNoticesList(testList)
- var newList = noticeController.getNoticesList()
- assert.equal(newList[0].id, 0)
- assert.equal(newList[0].title, 'Futuristic Notice')
- assert.equal(newList.length, 1)
- done()
- })
- })
-
describe('#markNoticeRead', function () {
it('should mark a notice as read', function (done) {
var testList = [{
@@ -86,7 +44,7 @@ describe('notice-controller', function () {
})
})
- describe('#getLatestUnreadNotice', function () {
+ describe('#getNextUnreadNotice', function () {
it('should retrieve the latest unread notice', function (done) {
var testList = [
{id: 0, read: true, title: 'Past Notice'},
@@ -94,8 +52,8 @@ describe('notice-controller', function () {
{id: 2, read: false, title: 'Future Notice'},
]
noticeController.setNoticesList(testList)
- var latestUnread = noticeController.getLatestUnreadNotice()
- assert.equal(latestUnread.id, 2)
+ var latestUnread = noticeController.getNextUnreadNotice()
+ assert.equal(latestUnread.id, 1)
done()
})
it('should return undefined if no unread notices exist.', function (done) {
@@ -105,7 +63,7 @@ describe('notice-controller', function () {
{id: 2, read: true, title: 'Future Notice'},
]
noticeController.setNoticesList(testList)
- var latestUnread = noticeController.getLatestUnreadNotice()
+ var latestUnread = noticeController.getNextUnreadNotice()
assert.ok(!latestUnread)
done()
})