aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-06-14 14:30:31 +0800
committerkumavis <aaron@kumavis.me>2018-06-14 14:30:31 +0800
commit44a8e48a04ea69e1f8e530ae1bacf55890f8df98 (patch)
tree5c344b5cb746b35504edb4b2903b2e533db527f6 /test/unit
parentac8b56a00defff4cb44a6a34251a19d8ab6159b6 (diff)
downloadtangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar.gz
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar.bz2
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar.lz
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar.xz
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.tar.zst
tangerine-wallet-browser-44a8e48a04ea69e1f8e530ae1bacf55890f8df98.zip
notices - replace getLatestNotice with getNextNotice
Diffstat (limited to 'test/unit')
-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()
})