Add missing mocks
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
requestPermission: jest.fn(),
|
||||||
|
onForegroundEvent: jest.fn(),
|
||||||
|
setBadgeCount: jest.fn(),
|
||||||
|
displayNotification: jest.fn(),
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export default {
|
||||||
|
configure: jest.fn().mockResolvedValue(0),
|
||||||
|
finish: jest.fn(),
|
||||||
|
}
|
||||||
+10
-9
@@ -64,7 +64,7 @@ export const mockedProfileStore = {
|
|||||||
isUser: true,
|
isUser: true,
|
||||||
isScene: false,
|
isScene: false,
|
||||||
setup: jest.fn().mockResolvedValue({aborted: false}),
|
setup: jest.fn().mockResolvedValue({aborted: false}),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
toggleFollowing: jest.fn().mockResolvedValue({}),
|
toggleFollowing: jest.fn().mockResolvedValue({}),
|
||||||
updateProfile: jest.fn(),
|
updateProfile: jest.fn(),
|
||||||
// unknown required because of the missing private methods: _xLoading, _xIdle, _load, _replaceAll
|
// unknown required because of the missing private methods: _xLoading, _xIdle, _load, _replaceAll
|
||||||
@@ -106,7 +106,7 @@ export const mockedMembersStore = {
|
|||||||
isEmpty: false,
|
isEmpty: false,
|
||||||
isMember: jest.fn(),
|
isMember: jest.fn(),
|
||||||
setup: jest.fn().mockResolvedValue({aborted: false}),
|
setup: jest.fn().mockResolvedValue({aborted: false}),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
loadMore: jest.fn(),
|
loadMore: jest.fn(),
|
||||||
removeMember: jest.fn(),
|
removeMember: jest.fn(),
|
||||||
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
|
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
|
||||||
@@ -149,7 +149,7 @@ export const mockedMembershipsStore = {
|
|||||||
isEmpty: false,
|
isEmpty: false,
|
||||||
isMemberOf: jest.fn(),
|
isMemberOf: jest.fn(),
|
||||||
setup: jest.fn().mockResolvedValue({aborted: false}),
|
setup: jest.fn().mockResolvedValue({aborted: false}),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
loadMore: jest.fn(),
|
loadMore: jest.fn(),
|
||||||
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
|
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
|
||||||
} as unknown as MembershipsViewModel
|
} as unknown as MembershipsViewModel
|
||||||
@@ -413,6 +413,7 @@ export const mockedNotificationsViewItemStore = {
|
|||||||
createdAt: '',
|
createdAt: '',
|
||||||
}),
|
}),
|
||||||
fetchAdditionalData: jest.fn(),
|
fetchAdditionalData: jest.fn(),
|
||||||
|
toNotifeeOpts: jest.fn(),
|
||||||
} as NotificationsViewItemModel
|
} as NotificationsViewItemModel
|
||||||
|
|
||||||
export const mockedNotificationsStore = {
|
export const mockedNotificationsStore = {
|
||||||
@@ -510,7 +511,7 @@ export const mockedNavigationTabStore = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
navigate: jest.fn(),
|
navigate: jest.fn(),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
goBack: jest.fn(),
|
goBack: jest.fn(),
|
||||||
fixedTabReset: jest.fn(),
|
fixedTabReset: jest.fn(),
|
||||||
goForward: jest.fn(),
|
goForward: jest.fn(),
|
||||||
@@ -539,7 +540,7 @@ export const mockedNavigationStore = {
|
|||||||
tabCount: 1,
|
tabCount: 1,
|
||||||
isCurrentScreen: jest.fn(),
|
isCurrentScreen: jest.fn(),
|
||||||
navigate: jest.fn(),
|
navigate: jest.fn(),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
setTitle: jest.fn(),
|
setTitle: jest.fn(),
|
||||||
handleLink: jest.fn(),
|
handleLink: jest.fn(),
|
||||||
switchTo: jest.fn(),
|
switchTo: jest.fn(),
|
||||||
@@ -679,7 +680,7 @@ export const mockedProfileUiStore = {
|
|||||||
setSelectedViewIndex: jest.fn(),
|
setSelectedViewIndex: jest.fn(),
|
||||||
setup: jest.fn().mockResolvedValue({aborted: false}),
|
setup: jest.fn().mockResolvedValue({aborted: false}),
|
||||||
update: jest.fn(),
|
update: jest.fn(),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
loadMore: jest.fn(),
|
loadMore: jest.fn(),
|
||||||
} as ProfileUiModel
|
} as ProfileUiModel
|
||||||
|
|
||||||
@@ -788,7 +789,7 @@ export const mockedSuggestedActorsStore = {
|
|||||||
hasError: false,
|
hasError: false,
|
||||||
isEmpty: false,
|
isEmpty: false,
|
||||||
setup: jest.fn().mockResolvedValue(null),
|
setup: jest.fn().mockResolvedValue(null),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _appendAll, _append
|
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _appendAll, _append
|
||||||
} as unknown as SuggestedActorsViewModel
|
} as unknown as SuggestedActorsViewModel
|
||||||
|
|
||||||
@@ -828,7 +829,7 @@ export const mockedUserFollowersStore = {
|
|||||||
hasError: false,
|
hasError: false,
|
||||||
isEmpty: false,
|
isEmpty: false,
|
||||||
setup: jest.fn(),
|
setup: jest.fn(),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
loadMore: jest.fn(),
|
loadMore: jest.fn(),
|
||||||
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
|
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
|
||||||
} as unknown as UserFollowersViewModel
|
} as unknown as UserFollowersViewModel
|
||||||
@@ -869,7 +870,7 @@ export const mockedUserFollowsStore = {
|
|||||||
hasError: false,
|
hasError: false,
|
||||||
isEmpty: false,
|
isEmpty: false,
|
||||||
setup: jest.fn(),
|
setup: jest.fn(),
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
loadMore: jest.fn(),
|
loadMore: jest.fn(),
|
||||||
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
|
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
|
||||||
} as unknown as UserFollowsViewModel
|
} as unknown as UserFollowsViewModel
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ describe('MeModel', () => {
|
|||||||
|
|
||||||
it('should update notifs count with fetchStateUpdate()', async () => {
|
it('should update notifs count with fetchStateUpdate()', async () => {
|
||||||
meModel.notifications = {
|
meModel.notifications = {
|
||||||
refresh: jest.fn(),
|
refresh: jest.fn().mockResolvedValue({}),
|
||||||
} as unknown as NotificationsViewModel
|
} as unknown as NotificationsViewModel
|
||||||
|
|
||||||
jest
|
jest
|
||||||
|
|||||||
Reference in New Issue
Block a user