Skip to content

Commit 71b2413

Browse files
fix react-native-permissions
1 parent f707179 commit 71b2413

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

__mocks__/react-native-permissions.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,30 @@ const requestNotifications: jest.Mock<Notification> = jest.fn((options: Record<s
3535
status: RESULTS.GRANTED,
3636
settings: Object.keys(options)
3737
.filter((option: string) => notificationOptions.includes(option))
38-
.reduce((acc: NotificationSettings, option: string) => ({...acc, [option]: true}), {
39-
lockScreen: true,
40-
notificationCenter: true,
41-
}),
38+
.reduce(
39+
(acc: NotificationSettings, option: string) => {
40+
acc[option] = true;
41+
return acc;
42+
},
43+
{
44+
lockScreen: true,
45+
notificationCenter: true,
46+
},
47+
),
4248
}));
4349

4450
const checkMultiple: jest.Mock<ResultsCollection> = jest.fn((permissions: string[]) =>
45-
permissions.reduce(
46-
(acc: ResultsCollection, permission: string) => ({
47-
...acc,
48-
[permission]: RESULTS.GRANTED,
49-
}),
50-
{},
51-
),
51+
permissions.reduce((acc: ResultsCollection, permission: string) => {
52+
acc[permission] = RESULTS.GRANTED;
53+
return acc;
54+
}, {}),
5255
);
5356

5457
const requestMultiple: jest.Mock<ResultsCollection> = jest.fn((permissions: string[]) =>
55-
permissions.reduce(
56-
(acc: ResultsCollection, permission: string) => ({
57-
...acc,
58-
[permission]: RESULTS.GRANTED,
59-
}),
60-
{},
61-
),
58+
permissions.reduce((acc: ResultsCollection, permission: string) => {
59+
acc[permission] = RESULTS.GRANTED;
60+
return acc;
61+
}, {}),
6262
);
6363

6464
export {

0 commit comments

Comments
 (0)