@@ -71,11 +71,44 @@ describe('Tests for SoundNotificationStore', function () {
7171 } ] ;
7272
7373 SoundNotificationStore . onIsNewNotification ( payload ) ;
74-
7574 expect ( SoundNotificationStore . showNotification ) . toHaveBeenCalled ( ) ;
7675
7776 } ) ;
7877
78+ it ( 'Should test notifications type/icon' , function ( ) {
79+
80+ spyOn ( SoundNotificationStore , 'newNotification' ) ;
81+
82+ var latestNotification = {
83+ 'title' : 'Greetings' , 'url' : 'https://api.github.com/repos/octokit/octokit.rb/issues/123' , 'type' : 'Commit'
84+ } ;
85+ SoundNotificationStore . showNotification ( 1 , latestNotification ) ;
86+ expect ( SoundNotificationStore . newNotification ) . toHaveBeenCalled ( ) ;
87+
88+ var latestNotification = {
89+ 'title' : 'Greetings' , 'url' : 'https://api.github.com/repos/octokit/octokit.rb/issues/123' , 'type' : 'Issue'
90+ } ;
91+ SoundNotificationStore . showNotification ( 1 , latestNotification ) ;
92+ expect ( SoundNotificationStore . newNotification ) . toHaveBeenCalled ( ) ;
93+
94+ var latestNotification = {
95+ 'title' : 'Greetings' , 'url' : 'https://api.github.com/repos/octokit/octokit.rb/issues/123' , 'type' : 'PullRequest'
96+ } ;
97+ SoundNotificationStore . showNotification ( 1 , latestNotification ) ;
98+ expect ( SoundNotificationStore . newNotification ) . toHaveBeenCalled ( ) ;
99+
100+ var latestNotification = {
101+ 'title' : 'Greetings' , 'url' : 'https://api.github.com/repos/octokit/octokit.rb/issues/123' , 'type' : 'AnotherType'
102+ } ;
103+ SoundNotificationStore . showNotification ( 1 , latestNotification ) ;
104+ expect ( SoundNotificationStore . newNotification ) . toHaveBeenCalled ( ) ;
105+
106+ var latestNotification = { } ;
107+ SoundNotificationStore . showNotification ( 2 , latestNotification ) ;
108+ expect ( SoundNotificationStore . newNotification ) . toHaveBeenCalled ( ) ;
109+
110+ } ) ;
111+
79112 it ( 'Should reopen gitify when a notification is clicked' , function ( ) {
80113 var nativeNotification = SoundNotificationStore . newNotification ( 'Test' , 'Hello, world!' ) ;
81114
0 commit comments