@@ -31,6 +31,8 @@ final class OneSignalNotificationsTests: XCTestCase {
31
31
var token : String = " "
32
32
33
33
override func setUpWithError( ) throws {
34
+ // Temp. logging to help debug during testing
35
+ OneSignalLog . setLogLevel ( . LL_VERBOSE)
34
36
// Put setup code here. This method is called before the invocation of each test method in the class.
35
37
self . notifTypes = 0
36
38
self . token = " "
@@ -44,6 +46,7 @@ final class OneSignalNotificationsTests: XCTestCase {
44
46
// NotificationManager Start to register lifecycle listener
45
47
OSNotificationsManager . start ( )
46
48
// Set badge count > 0
49
+ print ( " 💛 testClearBadgesWhenAppEntersForeground setting applicationIconBadgeNumber " )
47
50
UIApplication . shared. applicationIconBadgeNumber = 1
48
51
// Then background the app
49
52
OneSignalCoreMocks . backgroundApp ( )
@@ -57,6 +60,7 @@ final class OneSignalNotificationsTests: XCTestCase {
57
60
// NotificationManager Start to register lifecycle listener
58
61
OSNotificationsManager . start ( )
59
62
// Set badge count > 0
63
+ print ( " 💛 testDontclearBadgesWhenAppBecomesActive setting applicationIconBadgeNumber " )
60
64
UIApplication . shared. applicationIconBadgeNumber = 1
61
65
// Then resign active
62
66
OneSignalCoreMocks . resignActive ( )
@@ -65,58 +69,58 @@ final class OneSignalNotificationsTests: XCTestCase {
65
69
// Ensure that badge count == 1
66
70
XCTAssertEqual ( UIApplication . shared. applicationIconBadgeNumber, 1 )
67
71
}
68
-
69
- func testClearBadgesWhenAppEntersForeground1( ) throws {
70
- // NotificationManager Start to register lifecycle listener
71
- OSNotificationsManager . start ( )
72
- // Set badge count > 0
73
- UIApplication . shared. applicationIconBadgeNumber = 1
74
- // Then background the app
75
- OneSignalCoreMocks . backgroundApp ( )
76
- // Foreground the app
77
- OneSignalCoreMocks . foregroundApp ( )
78
- // Ensure that badge count == 0
79
- XCTAssertEqual ( UIApplication . shared. applicationIconBadgeNumber, 0 )
80
- }
81
-
82
- func testDontclearBadgesWhenAppBecomesActive2( ) throws {
83
- // NotificationManager Start to register lifecycle listener
84
- OSNotificationsManager . start ( )
85
- // Set badge count > 0
86
- UIApplication . shared. applicationIconBadgeNumber = 1
87
- // Then resign active
88
- OneSignalCoreMocks . resignActive ( )
89
- // App becomes active the app
90
- OneSignalCoreMocks . becomeActive ( )
91
- // Ensure that badge count == 1
92
- XCTAssertEqual ( UIApplication . shared. applicationIconBadgeNumber, 1 )
93
- }
94
-
95
- func testClearBadgesWhenAppEntersForeground3( ) throws {
96
- // NotificationManager Start to register lifecycle listener
97
- OSNotificationsManager . start ( )
98
- // Set badge count > 0
99
- UIApplication . shared. applicationIconBadgeNumber = 1
100
- // Then background the app
101
- OneSignalCoreMocks . backgroundApp ( )
102
- // Foreground the app
103
- OneSignalCoreMocks . foregroundApp ( )
104
- // Ensure that badge count == 0
105
- XCTAssertEqual ( UIApplication . shared. applicationIconBadgeNumber, 0 )
106
- }
107
-
108
- func testDontclearBadgesWhenAppBecomesActive4( ) throws {
109
- // NotificationManager Start to register lifecycle listener
110
- OSNotificationsManager . start ( )
111
- // Set badge count > 0
112
- UIApplication . shared. applicationIconBadgeNumber = 1
113
- // Then resign active
114
- OneSignalCoreMocks . resignActive ( )
115
- // App becomes active the app
116
- OneSignalCoreMocks . becomeActive ( )
117
- // Ensure that badge count == 1
118
- XCTAssertEqual ( UIApplication . shared. applicationIconBadgeNumber, 1 )
119
- }
72
+ //
73
+ // func testClearBadgesWhenAppEntersForeground1() throws {
74
+ // // NotificationManager Start to register lifecycle listener
75
+ // OSNotificationsManager.start()
76
+ // // Set badge count > 0
77
+ // UIApplication.shared.applicationIconBadgeNumber = 1
78
+ // // Then background the app
79
+ // OneSignalCoreMocks.backgroundApp()
80
+ // // Foreground the app
81
+ // OneSignalCoreMocks.foregroundApp()
82
+ // // Ensure that badge count == 0
83
+ // XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 0)
84
+ // }
85
+ //
86
+ // func testDontclearBadgesWhenAppBecomesActive2() throws {
87
+ // // NotificationManager Start to register lifecycle listener
88
+ // OSNotificationsManager.start()
89
+ // // Set badge count > 0
90
+ // UIApplication.shared.applicationIconBadgeNumber = 1
91
+ // // Then resign active
92
+ // OneSignalCoreMocks.resignActive()
93
+ // // App becomes active the app
94
+ // OneSignalCoreMocks.becomeActive()
95
+ // // Ensure that badge count == 1
96
+ // XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 1)
97
+ // }
98
+ //
99
+ // func testClearBadgesWhenAppEntersForeground3() throws {
100
+ // // NotificationManager Start to register lifecycle listener
101
+ // OSNotificationsManager.start()
102
+ // // Set badge count > 0
103
+ // UIApplication.shared.applicationIconBadgeNumber = 1
104
+ // // Then background the app
105
+ // OneSignalCoreMocks.backgroundApp()
106
+ // // Foreground the app
107
+ // OneSignalCoreMocks.foregroundApp()
108
+ // // Ensure that badge count == 0
109
+ // XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 0)
110
+ // }
111
+ //
112
+ // func testDontclearBadgesWhenAppBecomesActive4() throws {
113
+ // // NotificationManager Start to register lifecycle listener
114
+ // OSNotificationsManager.start()
115
+ // // Set badge count > 0
116
+ // UIApplication.shared.applicationIconBadgeNumber = 1
117
+ // // Then resign active
118
+ // OneSignalCoreMocks.resignActive()
119
+ // // App becomes active the app
120
+ // OneSignalCoreMocks.becomeActive()
121
+ // // Ensure that badge count == 1
122
+ // XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 1)
123
+ // }
120
124
121
125
func testUpdateNotificationTypesOnAppEntersForeground( ) throws {
122
126
// NotificationManager Start to register lifecycle listener
0 commit comments