|
@@ -31,7 +31,9 @@ describe('EventsRegistry', () => {
|
31
|
31
|
|
32
|
32
|
expect(result).toBe(subscription);
|
33
|
33
|
expect(mockNativeEventsReceiver.registerComponentDidAppear).toHaveBeenCalledTimes(1);
|
34
|
|
- expect(mockNativeEventsReceiver.registerComponentDidAppear).toHaveBeenCalledWith(cb);
|
|
34
|
+
|
|
35
|
+ mockNativeEventsReceiver.registerComponentDidAppear.mock.calls[0][0]({ componentId: 'theId' });
|
|
36
|
+ expect(cb).toHaveBeenCalledWith('theId', '');
|
35
|
37
|
});
|
36
|
38
|
|
37
|
39
|
it('exposes componentDidDisappear event', () => {
|
|
@@ -43,7 +45,9 @@ describe('EventsRegistry', () => {
|
43
|
45
|
|
44
|
46
|
expect(result).toBe(subscription);
|
45
|
47
|
expect(mockNativeEventsReceiver.registerComponentDidDisappear).toHaveBeenCalledTimes(1);
|
46
|
|
- expect(mockNativeEventsReceiver.registerComponentDidDisappear).toHaveBeenCalledWith(cb);
|
|
48
|
+
|
|
49
|
+ mockNativeEventsReceiver.registerComponentDidDisappear.mock.calls[0][0]({ componentId: 'theId' });
|
|
50
|
+ expect(cb).toHaveBeenCalledWith('theId', '');
|
47
|
51
|
});
|
48
|
52
|
|
49
|
53
|
it('exposes onNavigationButtonPressed event', () => {
|
|
@@ -55,6 +59,8 @@ describe('EventsRegistry', () => {
|
55
|
59
|
|
56
|
60
|
expect(result).toBe(subscription);
|
57
|
61
|
expect(mockNativeEventsReceiver.registerOnNavigationButtonPressed).toHaveBeenCalledTimes(1);
|
58
|
|
- expect(mockNativeEventsReceiver.registerOnNavigationButtonPressed).toHaveBeenCalledWith(cb);
|
|
62
|
+
|
|
63
|
+ mockNativeEventsReceiver.registerOnNavigationButtonPressed.mock.calls[0][0]({ componentId: 'theId', buttonId: 'theBtnId' });
|
|
64
|
+ expect(cb).toHaveBeenCalledWith('theId', 'theBtnId');
|
59
|
65
|
});
|
60
|
66
|
});
|