diff options
Diffstat (limited to 'js/tests/services/businesslayer/itembusinesslayerSpec.coffee')
-rw-r--r-- | js/tests/services/businesslayer/itembusinesslayerSpec.coffee | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/tests/services/businesslayer/itembusinesslayerSpec.coffee b/js/tests/services/businesslayer/itembusinesslayerSpec.coffee index 932260747..0bc8a3188 100644 --- a/js/tests/services/businesslayer/itembusinesslayerSpec.coffee +++ b/js/tests/services/businesslayer/itembusinesslayerSpec.coffee @@ -117,6 +117,20 @@ describe 'ItemBusinessLayer', -> expect(@persistence.readItem).toHaveBeenCalledWith(2) + it 'should not set an item read if its kept unread', => + @persistence.readItem = jasmine.createSpy('read item') + + item = {id: 2, feedId: 5, guidHash: 'a3', status: 0, keptUnread: true} + @ItemModel.add(item) + item.setUnread() + + @ItemBusinessLayer.setRead(2) + + expect(item.isRead()).toBe(false) + expect(@persistence.readItem).not.toHaveBeenCalled() + + + it 'should no set an item read if its already read', => @persistence.readItem = jasmine.createSpy('read item') @@ -214,4 +228,6 @@ describe 'ItemBusinessLayer', -> @ItemBusinessLayer.setUnread(2) - expect(@item1.unreadCount).toBe(135)
\ No newline at end of file + expect(@item1.unreadCount).toBe(135) + + |