diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-06-15 00:49:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-15 00:49:38 +0800 |
commit | 3a5089da6faa35d6dc20dacbd87717e055a61a34 (patch) | |
tree | 3d55d150d69405b8c2d76ca9f3c4511626dbc5fb /test/unit | |
parent | 1f83a110b959fcf9d8fa7cedb852f6c665bd0fc5 (diff) | |
parent | c2afb7903522d87345f4a39f7ca3df8fa8889d53 (diff) | |
download | tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar.gz tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar.bz2 tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar.lz tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar.xz tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.tar.zst tangerine-wallet-browser-3a5089da6faa35d6dc20dacbd87717e055a61a34.zip |
Merge pull request #4566 from MetaMask/notice-phishing
Push new notice on recent phishing incidents
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/app/controllers/notice-controller-test.js | 50 |
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() }) |