@@ -4,7 +4,19 @@ exports[`should support useImplementingTypes 1`] = `
4
4
"
5
5
export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
6
6
return {
7
- configTypes: overrides && overrides .hasOwnProperty (' configTypes' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
7
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
8
+ };
9
+ } ;
10
+
11
+ export const mockField = (overrides?: Partial<Field >): Field => {
12
+ return {
13
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
14
+ };
15
+ } ;
16
+
17
+ export const mockAction = (overrides?: Partial<Action >): Action => {
18
+ return {
19
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
8
20
};
9
21
} ;
10
22
@@ -14,6 +26,9 @@ export const mockA = (overrides?: Partial<A>): A => {
14
26
str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
15
27
obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
16
28
config: overrides && overrides .hasOwnProperty (' config' ) ? overrides .config ! : mockTestAConfig () || mockTestTwoAConfig (),
29
+ configArray: overrides && overrides .hasOwnProperty (' configArray' ) ? overrides .configArray ! : [mockTestAConfig () || mockTestTwoAConfig ()],
30
+ field: overrides && overrides .hasOwnProperty (' field' ) ? overrides .field ! : mockTestTwoAConfig (),
31
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : mockTestAction (),
17
32
};
18
33
} ;
19
34
@@ -27,25 +42,44 @@ export const mockB = (overrides?: Partial<B>): B => {
27
42
28
43
export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
29
44
return {
30
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
45
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
31
46
active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
32
47
};
33
48
} ;
34
49
35
50
export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
36
51
return {
37
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
52
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
38
53
username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
39
54
};
40
55
} ;
56
+
57
+ export const mockTestAction = (overrides?: Partial<TestAction >): TestAction => {
58
+ return {
59
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
60
+ createdAt: overrides && overrides .hasOwnProperty (' createdAt' ) ? overrides .createdAt ! : ' voluptate' ,
61
+ };
62
+ } ;
41
63
"
42
64
`;
43
65
44
66
exports[`shouldn't support useImplementingTypes 1`] = `
45
67
"
46
68
export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
47
69
return {
48
- configTypes: overrides && overrides .hasOwnProperty (' configTypes' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
70
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
71
+ };
72
+ } ;
73
+
74
+ export const mockField = (overrides?: Partial<Field >): Field => {
75
+ return {
76
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
77
+ };
78
+ } ;
79
+
80
+ export const mockAction = (overrides?: Partial<Action >): Action => {
81
+ return {
82
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
49
83
};
50
84
} ;
51
85
@@ -55,6 +89,9 @@ export const mockA = (overrides?: Partial<A>): A => {
55
89
str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
56
90
obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
57
91
config: overrides && overrides .hasOwnProperty (' config' ) ? overrides .config ! : mockAConfig (),
92
+ configArray: overrides && overrides .hasOwnProperty (' configArray' ) ? overrides .configArray ! : [mockAConfig ()],
93
+ field: overrides && overrides .hasOwnProperty (' field' ) ? overrides .field ! : mockField (),
94
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : mockAction (),
58
95
};
59
96
} ;
60
97
@@ -68,25 +105,44 @@ export const mockB = (overrides?: Partial<B>): B => {
68
105
69
106
export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
70
107
return {
71
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
108
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
72
109
active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
73
110
};
74
111
} ;
75
112
76
113
export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
77
114
return {
78
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
115
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
79
116
username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
80
117
};
81
118
} ;
119
+
120
+ export const mockTestAction = (overrides?: Partial<TestAction >): TestAction => {
121
+ return {
122
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
123
+ createdAt: overrides && overrides .hasOwnProperty (' createdAt' ) ? overrides .createdAt ! : ' voluptate' ,
124
+ };
125
+ } ;
82
126
"
83
127
`;
84
128
85
129
exports[`support useImplementingTypes with fieldGeneration prop 1`] = `
86
130
"
87
131
export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
88
132
return {
89
- configTypes: overrides && overrides .hasOwnProperty (' configTypes' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
133
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
134
+ };
135
+ } ;
136
+
137
+ export const mockField = (overrides?: Partial<Field >): Field => {
138
+ return {
139
+ testTypes: overrides && overrides .hasOwnProperty (' testTypes' ) ? overrides .testTypes ! : [TestObj .Test ],
140
+ };
141
+ } ;
142
+
143
+ export const mockAction = (overrides?: Partial<Action >): Action => {
144
+ return {
145
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
90
146
};
91
147
} ;
92
148
@@ -96,6 +152,9 @@ export const mockA = (overrides?: Partial<A>): A => {
96
152
str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
97
153
obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
98
154
config: overrides && overrides .hasOwnProperty (' config' ) ? overrides .config ! : ' [email protected] ' ,
155
+ configArray: overrides && overrides .hasOwnProperty (' configArray' ) ? overrides .configArray ! : [mockTestAConfig () || mockTestTwoAConfig ()],
156
+ field: overrides && overrides .hasOwnProperty (' field' ) ? overrides .field ! : mockTestTwoAConfig (),
157
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : mockTestAction (),
99
158
};
100
159
} ;
101
160
@@ -109,16 +168,23 @@ export const mockB = (overrides?: Partial<B>): B => {
109
168
110
169
export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
111
170
return {
112
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
171
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
113
172
active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
114
173
};
115
174
} ;
116
175
117
176
export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
118
177
return {
119
- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
178
+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
120
179
username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
121
180
};
122
181
} ;
182
+
183
+ export const mockTestAction = (overrides?: Partial<TestAction >): TestAction => {
184
+ return {
185
+ action: overrides && overrides .hasOwnProperty (' action' ) ? overrides .action ! : [TestObj .Test ],
186
+ createdAt: overrides && overrides .hasOwnProperty (' createdAt' ) ? overrides .createdAt ! : ' voluptate' ,
187
+ };
188
+ } ;
123
189
"
124
190
`;
0 commit comments