Skip to content

Commit b493c1d

Browse files
committed
pr feedback
1 parent 046d111 commit b493c1d

File tree

5 files changed

+35
-45
lines changed

5 files changed

+35
-45
lines changed

www/DebugNamespace.test.ts

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,42 @@ describe('Debug', () => {
1414
});
1515

1616
test.each([
17-
[LogLevel.None, 'None'],
18-
[LogLevel.Fatal, 'Fatal'],
19-
[LogLevel.Error, 'Error'],
20-
[LogLevel.Warn, 'Warn'],
21-
[LogLevel.Info, 'Info'],
22-
[LogLevel.Debug, 'Debug'],
23-
[LogLevel.Verbose, 'Verbose'],
24-
])(
25-
'should call cordova.exec for setLogLevel with %s',
26-
(logLevel, levelName) => {
27-
debug.setLogLevel(logLevel);
17+
[LogLevel.None],
18+
[LogLevel.Fatal],
19+
[LogLevel.Error],
20+
[LogLevel.Warn],
21+
[LogLevel.Info],
22+
[LogLevel.Debug],
23+
[LogLevel.Verbose],
24+
])('should call cordova.exec for setLogLevel with %s', (logLevel) => {
25+
debug.setLogLevel(logLevel);
2826

29-
expect(window.cordova.exec).toHaveBeenCalledWith(
30-
expect.any(Function),
31-
expect.any(Function),
32-
'OneSignalPush',
33-
'setLogLevel',
34-
[logLevel],
35-
);
36-
},
37-
);
27+
expect(window.cordova.exec).toHaveBeenCalledWith(
28+
expect.any(Function),
29+
expect.any(Function),
30+
'OneSignalPush',
31+
'setLogLevel',
32+
[logLevel],
33+
);
34+
});
3835

3936
test.each([
40-
[LogLevel.None, 'None'],
41-
[LogLevel.Fatal, 'Fatal'],
42-
[LogLevel.Error, 'Error'],
43-
[LogLevel.Warn, 'Warn'],
44-
[LogLevel.Info, 'Info'],
45-
[LogLevel.Debug, 'Debug'],
46-
[LogLevel.Verbose, 'Verbose'],
47-
])(
48-
'should call cordova.exec for setAlertLevel with %s',
49-
(logLevel, levelName) => {
50-
debug.setAlertLevel(logLevel);
37+
[LogLevel.None],
38+
[LogLevel.Fatal],
39+
[LogLevel.Error],
40+
[LogLevel.Warn],
41+
[LogLevel.Info],
42+
[LogLevel.Debug],
43+
[LogLevel.Verbose],
44+
])('should call cordova.exec for setAlertLevel with %s', (logLevel) => {
45+
debug.setAlertLevel(logLevel);
5146

52-
expect(window.cordova.exec).toHaveBeenCalledWith(
53-
expect.any(Function),
54-
expect.any(Function),
55-
'OneSignalPush',
56-
'setAlertLevel',
57-
[logLevel],
58-
);
59-
},
60-
);
47+
expect(window.cordova.exec).toHaveBeenCalledWith(
48+
expect.any(Function),
49+
expect.any(Function),
50+
'OneSignalPush',
51+
'setAlertLevel',
52+
[logLevel],
53+
);
54+
});
6155
});

www/InAppMessagesNamespace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('InAppMessages', () => {
7575
[],
7676
);
7777

78-
// call to process listner
78+
// call to process listener
7979
mockExec.mock.calls[0][0](data);
8080

8181
expect(mockListener).toHaveBeenCalledWith(data);

www/NotificationsNamespace.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export default class Notifications {
5151
);
5252

5353
this.addEventListener('permissionChange', (result) => {
54-
console.log('permissionChange', result);
5554
this._permission = result;
5655
});
5756
}

www/PushSubscriptionNamespace.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe('PushSubscription', () => {
4343
const listener = mockExec.mock.calls.find(
4444
(call) => call[3] === 'addPushSubscriptionObserver',
4545
)?.[0];
46-
console.log(listener);
4746
listener?.({ current: { id: SUB_ID, token: SUB_TOKEN, optedIn: true } });
4847
expect(pushSubscription.id).toBe(SUB_ID);
4948
});
@@ -66,7 +65,6 @@ describe('PushSubscription', () => {
6665
const listener = mockExec.mock.calls.find(
6766
(call) => call[3] === 'addPushSubscriptionObserver',
6867
)?.[0];
69-
console.log(listener);
7068
listener?.({ current: { id: SUB_ID, token: SUB_TOKEN, optedIn: true } });
7169
expect(pushSubscription.token).toBe(SUB_TOKEN);
7270
});

www/PushSubscriptionNamespace.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export default class PushSubscription {
7878
);
7979

8080
this.addEventListener('change', (subscriptionChange) => {
81-
console.log('subscriptionChange', subscriptionChange);
8281
this._id = subscriptionChange.current.id;
8382
this._token = subscriptionChange.current.token;
8483
this._optedIn = subscriptionChange.current.optedIn;

0 commit comments

Comments
 (0)