|
|
@@ -17,55 +17,25 @@ describe('Commands', () => {
|
|
17
|
17
|
it('sends startApp to native', () => {
|
|
18
|
18
|
uut.startApp({
|
|
19
|
19
|
container: {
|
|
20
|
|
- key: 'example.MyContainer'
|
|
|
20
|
+ key: 'com.example.MyScreen'
|
|
21
|
21
|
}
|
|
22
|
22
|
});
|
|
23
|
23
|
expect(mockNativeNavigation.startApp).toHaveBeenCalledTimes(1);
|
|
24
|
24
|
});
|
|
25
|
25
|
|
|
26
|
|
- it('parses the params and construct single screen hirarchy', () => {
|
|
|
26
|
+ it('adds uniqueId to passed container', () => {
|
|
27
|
27
|
mockUniqueIdProvider.uniqueId = jest.fn((prefix) => `${prefix}123`);
|
|
28
|
|
-
|
|
29
|
|
- expect(uut.parse(
|
|
30
|
|
- {
|
|
31
|
|
- container: {
|
|
32
|
|
- key: 'com.example.MyScreen'
|
|
33
|
|
- }
|
|
34
|
|
- })).toEqual(
|
|
35
|
|
- {
|
|
36
|
|
- containerStack: {
|
|
37
|
|
- id: 'containerStack123',
|
|
38
|
|
- stack: [
|
|
39
|
|
- {
|
|
40
|
|
- container: {
|
|
41
|
|
- key: 'com.example.MyScreen',
|
|
42
|
|
- id: 'container123'
|
|
43
|
|
- }
|
|
44
|
|
- }
|
|
45
|
|
- ]
|
|
46
|
|
- }
|
|
47
|
|
- });
|
|
|
28
|
+ uut.startApp({
|
|
|
29
|
+ container: {
|
|
|
30
|
+ key: 'com.example.MyScreen'
|
|
|
31
|
+ }
|
|
|
32
|
+ });
|
|
|
33
|
+ expect(mockNativeNavigation.startApp).toHaveBeenCalledWith({
|
|
|
34
|
+ container: {
|
|
|
35
|
+ key: 'com.example.MyScreen',
|
|
|
36
|
+ id: 'container123'
|
|
|
37
|
+ }
|
|
|
38
|
+ });
|
|
48
|
39
|
});
|
|
49
|
|
- //it('receives params object', () => {
|
|
50
|
|
- // uut.startApp({
|
|
51
|
|
- // container: {
|
|
52
|
|
- // key: 'example.MyContainer'
|
|
53
|
|
- // },
|
|
54
|
|
- // drawer: {
|
|
55
|
|
- // left: {
|
|
56
|
|
- // key: 'example.SideMenu'
|
|
57
|
|
- // }
|
|
58
|
|
- // }
|
|
59
|
|
- // });
|
|
60
|
|
- //});
|
|
61
|
|
- //it('expects to get containerKey, or tabs with containerKeys', () => {
|
|
62
|
|
- // expect(() => uut.startApp({containerKey: 'example.MyContainer'})).not.toThrow();
|
|
63
|
|
- // expect(() => uut.startApp({tabs: [{containerKey: 'example.Tab1'}]})).not.toThrow();
|
|
64
|
|
- // expect(() => uut.startApp()).toThrow();
|
|
65
|
|
- // expect(() => uut.startApp({})).toThrow();
|
|
66
|
|
- // expect(() => uut.startApp({tabs: []})).toThrow();
|
|
67
|
|
- // expect(() => uut.startApp({tabs: [{}]})).toThrow();
|
|
68
|
|
- // expect(() => uut.startApp({tabs: [{containerKey: 'example.Tab1'}, {}]})).toThrow();
|
|
69
|
|
- //});
|
|
70
|
40
|
});
|
|
71
|
41
|
});
|