summaryrefslogtreecommitdiffstats
path: root/js/tests/services/businesslayer/itembusinesslayerSpec.coffee
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-15 18:31:30 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-15 18:31:30 +0200
commit0ed9131f3f1c851158421b39767bf94264f80b8b (patch)
tree51ee951c0c7cd6cff6a3cd1456e2987a8943edaa /js/tests/services/businesslayer/itembusinesslayerSpec.coffee
parent7c3c70fc88b669386cca180250081be45cdfeb92 (diff)
add simple keyboard shortcuts, implemt keep unread fix #43, implement mark as read when scrolling fix #4
Diffstat (limited to 'js/tests/services/businesslayer/itembusinesslayerSpec.coffee')
-rw-r--r--js/tests/services/businesslayer/itembusinesslayerSpec.coffee18
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)
+
+