@@ -4,7 +4,19 @@ exports[`should support useImplementingTypes 1`] = `
44"
55export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
66 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 ],
820 };
921} ;
1022
@@ -14,6 +26,9 @@ export const mockA = (overrides?: Partial<A>): A => {
1426 str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
1527 obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
1628 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 (),
1732 };
1833} ;
1934
@@ -27,25 +42,44 @@ export const mockB = (overrides?: Partial<B>): B => {
2742
2843export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
2944 return {
30- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
45+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
3146 active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
3247 };
3348} ;
3449
3550export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
3651 return {
37- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
52+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
3853 username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
3954 };
4055} ;
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+ } ;
4163"
4264`;
4365
4466exports[`shouldn't support useImplementingTypes 1`] = `
4567"
4668export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
4769 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 ],
4983 };
5084} ;
5185
@@ -55,6 +89,9 @@ export const mockA = (overrides?: Partial<A>): A => {
5589 str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
5690 obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
5791 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 (),
5895 };
5996} ;
6097
@@ -68,25 +105,44 @@ export const mockB = (overrides?: Partial<B>): B => {
68105
69106export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
70107 return {
71- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
108+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
72109 active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
73110 };
74111} ;
75112
76113export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
77114 return {
78- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
115+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
79116 username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
80117 };
81118} ;
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+ } ;
82126"
83127`;
84128
85129exports[`support useImplementingTypes with fieldGeneration prop 1`] = `
86130"
87131export const mockAConfig = (overrides?: Partial<AConfig >): AConfig => {
88132 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 ],
90146 };
91147} ;
92148
@@ -96,6 +152,9 @@ export const mockA = (overrides?: Partial<A>): A => {
96152 str: overrides && overrides .hasOwnProperty (' str' ) ? overrides .str ! : ' ea' ,
97153 obj: overrides && overrides .hasOwnProperty (' obj' ) ? overrides .obj ! : mockB (),
98154 config: overrides && overrides .hasOwnProperty (' config' ) ? overrides .config ! : ' Karelle_Kassulke@Carolyne.io' ,
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 (),
99158 };
100159} ;
101160
@@ -109,16 +168,23 @@ export const mockB = (overrides?: Partial<B>): B => {
109168
110169export const mockTestAConfig = (overrides?: Partial<TestAConfig >): TestAConfig => {
111170 return {
112- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
171+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
113172 active: overrides && overrides .hasOwnProperty (' active' ) ? overrides .active ! : true ,
114173 };
115174} ;
116175
117176export const mockTestTwoAConfig = (overrides?: Partial<TestTwoAConfig >): TestTwoAConfig => {
118177 return {
119- configTypes : overrides && overrides .hasOwnProperty (' configTypes ' ) ? overrides .configTypes ! : [ConfigTypes .Test ],
178+ testTypes : overrides && overrides .hasOwnProperty (' testTypes ' ) ? overrides .testTypes ! : [TestObj .Test ],
120179 username: overrides && overrides .hasOwnProperty (' username' ) ? overrides .username ! : ' et' ,
121180 };
122181} ;
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+ } ;
123189"
124190`;
0 commit comments