@@ -14,7 +14,7 @@ import {
1414} from './camel-to-tile.adapter' ;
1515
1616describe ( 'camelComponentToTile' , ( ) => {
17- it ( 'should return a tile with the correct type' , ( ) => {
17+ it ( 'should return a tile with the correct type' , async ( ) => {
1818 const componentDef = {
1919 component : {
2020 name : 'my-component' ,
@@ -23,80 +23,79 @@ describe('camelComponentToTile', () => {
2323 } ,
2424 } as ICamelComponentDefinition ;
2525
26- const tile = camelComponentToTile ( componentDef ) ;
26+ const tile = await camelComponentToTile ( componentDef ) ;
2727
28- expect ( tile . type ) . toEqual ( CatalogKind . Component ) ;
2928 expect ( tile . name ) . toEqual ( 'my-component' ) ;
3029 expect ( tile . description ) . toEqual ( 'My Component Description' ) ;
3130 } ) ;
3231
33- it ( 'should populate the headerTags' , ( ) => {
32+ it ( 'should populate the headerTags' , async ( ) => {
3433 const componentDef = {
3534 component : {
3635 supportLevel : 'Preview' ,
3736 } ,
3837 } as ICamelComponentDefinition ;
3938
40- const tile = camelComponentToTile ( componentDef ) ;
39+ const tile = await camelComponentToTile ( componentDef ) ;
4140
4241 expect ( tile . headerTags ) . toEqual ( [ 'Component' , 'Preview' ] ) ;
4342 } ) ;
4443
45- it ( 'should populate the tags and version' , ( ) => {
44+ it ( 'should populate the tags and version' , async ( ) => {
4645 const componentDef = {
4746 component : {
4847 label : 'label1,label2' ,
4948 version : '4.0.0' ,
5049 } ,
5150 } as ICamelComponentDefinition ;
5251
53- const tile = camelComponentToTile ( componentDef ) ;
52+ const tile = await camelComponentToTile ( componentDef ) ;
5453
5554 expect ( tile . tags ) . toEqual ( [ 'label1' , 'label2' ] ) ;
5655 expect ( tile . version ) . toEqual ( '4.0.0' ) ;
5756 } ) ;
5857
59- it ( 'should populate the provider' , ( ) => {
58+ it ( 'should populate the provider' , async ( ) => {
6059 const componentDef = {
6160 component : {
6261 provider : 'my-provider' ,
6362 } ,
6463 } as ICamelComponentDefinition ;
6564
66- const tile = camelComponentToTile ( componentDef ) ;
65+ const tile = await camelComponentToTile ( componentDef ) ;
6766
6867 expect ( tile . provider ) . toEqual ( 'my-provider' ) ;
6968 } ) ;
7069
71- it ( 'should populate tags with `consumerOnly` and `producerOnly` when applicable' , ( ) => {
70+ it ( 'should populate tags with `consumerOnly` and `producerOnly` when applicable' , async ( ) => {
7271 const componentDef = {
7372 component : {
7473 consumerOnly : true ,
7574 producerOnly : true ,
7675 } ,
7776 } as ICamelComponentDefinition ;
7877
79- const tile = camelComponentToTile ( componentDef ) ;
78+ const tile = await camelComponentToTile ( componentDef ) ;
8079
8180 expect ( tile . tags ) . toEqual ( [ 'consumerOnly' , 'producerOnly' ] ) ;
8281 } ) ;
8382
84- it ( 'should replace the supportLevel header tag if the component is deprecated' , ( ) => {
83+ it ( 'should replace the supportLevel header tag if the component is deprecated' , async ( ) => {
8584 const componentDef = {
8685 component : {
8786 supportLevel : 'Stable' ,
8887 deprecated : true ,
8988 } ,
9089 } as ICamelComponentDefinition ;
9190
92- const tile = camelComponentToTile ( componentDef ) ;
91+ const tile = await camelComponentToTile ( componentDef ) ;
9392
9493 expect ( tile . headerTags ) . toEqual ( [ 'Component' , 'Deprecated' ] ) ;
9594 } ) ;
9695} ) ;
9796
9897describe ( 'camelProcessorToTile' , ( ) => {
99- it ( 'should return a tile with the correct type' , ( ) => {
98+ it ( 'should return a tile with the correct type' , async ( ) => {
10099 const processorDef = {
101100 model : {
102101 name : 'my-processor' ,
@@ -106,39 +105,38 @@ describe('camelProcessorToTile', () => {
106105 } ,
107106 } as ICamelProcessorDefinition ;
108107
109- const tile = camelProcessorToTile ( processorDef ) ;
108+ const tile = await camelProcessorToTile ( processorDef ) ;
110109
111- expect ( tile . type ) . toEqual ( CatalogKind . Processor ) ;
112110 expect ( tile . name ) . toEqual ( 'my-processor' ) ;
113111 expect ( tile . description ) . toEqual ( 'My Processor Description' ) ;
114112 } ) ;
115113
116- it ( 'should populate the headerTags' , ( ) => {
114+ it ( 'should populate the headerTags' , async ( ) => {
117115 const processorDef = {
118116 model : {
119117 supportLevel : 'Preview' ,
120118 label : 'label1,label2' ,
121119 } ,
122120 } as ICamelProcessorDefinition ;
123121
124- const tile = camelProcessorToTile ( processorDef ) ;
122+ const tile = await camelProcessorToTile ( processorDef ) ;
125123
126124 expect ( tile . headerTags ) . toEqual ( [ 'Processor' , 'Preview' ] ) ;
127125 } ) ;
128126
129- it ( 'should populate the tags' , ( ) => {
127+ it ( 'should populate the tags' , async ( ) => {
130128 const processorDef = {
131129 model : {
132130 label : 'label1,label2' ,
133131 } ,
134132 } as ICamelProcessorDefinition ;
135133
136- const tile = camelProcessorToTile ( processorDef ) ;
134+ const tile = await camelProcessorToTile ( processorDef ) ;
137135
138136 expect ( tile . tags ) . toEqual ( [ 'label1' , 'label2' ] ) ;
139137 } ) ;
140138
141- it ( 'should populate the provider' , ( ) => {
139+ it ( 'should populate the provider' , async ( ) => {
142140 const processorDef = {
143141 model : {
144142 name : 'my-processor' ,
@@ -149,14 +147,14 @@ describe('camelProcessorToTile', () => {
149147 } ,
150148 } as ICamelProcessorDefinition ;
151149
152- const tile = camelProcessorToTile ( processorDef ) ;
150+ const tile = await camelProcessorToTile ( processorDef ) ;
153151
154152 expect ( tile . provider ) . toEqual ( 'my-provider' ) ;
155153 } ) ;
156154} ) ;
157155
158156describe ( 'camelEntityToTile' , ( ) => {
159- it ( 'should return a tile with the correct type' , ( ) => {
157+ it ( 'should return a tile with the correct type' , async ( ) => {
160158 const processorDef = {
161159 model : {
162160 name : 'my-entity' ,
@@ -166,16 +164,15 @@ describe('camelEntityToTile', () => {
166164 } ,
167165 } as ICamelProcessorDefinition ;
168166
169- const tile = camelEntityToTile ( processorDef ) ;
167+ const tile = await camelEntityToTile ( processorDef ) ;
170168
171- expect ( tile . type ) . toEqual ( CatalogKind . Entity ) ;
172169 expect ( tile . name ) . toEqual ( 'my-entity' ) ;
173170 expect ( tile . description ) . toEqual ( 'My Entity Description' ) ;
174171 } ) ;
175172} ) ;
176173
177174describe ( 'citrusComponentToTile' , ( ) => {
178- it ( 'should return a tile with the correct type' , ( ) => {
175+ it ( 'should return a tile with the correct type' , async ( ) => {
179176 const componentDef = {
180177 kind : CatalogKind . TestAction ,
181178 name : 'my-action' ,
@@ -184,31 +181,29 @@ describe('citrusComponentToTile', () => {
184181 description : 'This is the description' ,
185182 } as ICitrusComponentDefinition ;
186183
187- const tile = citrusComponentToTile ( componentDef ) ;
184+ const tile = await citrusComponentToTile ( componentDef ) ;
188185
189- expect ( tile . type ) . toEqual ( CatalogKind . TestAction ) ;
190186 expect ( tile . name ) . toEqual ( 'my-action' ) ;
191187 expect ( tile . title ) . toEqual ( 'My Action' ) ;
192188 expect ( tile . description ) . toEqual ( 'This is the description' ) ;
193189 } ) ;
194190
195- it ( 'should return a tile with defaults' , ( ) => {
191+ it ( 'should return a tile with defaults' , async ( ) => {
196192 const componentDef = {
197193 kind : CatalogKind . TestContainer ,
198194 name : 'my-container' ,
199195 } as ICitrusComponentDefinition ;
200196
201- const tile = citrusComponentToTile ( componentDef ) ;
197+ const tile = await citrusComponentToTile ( componentDef ) ;
202198
203- expect ( tile . type ) . toEqual ( CatalogKind . TestContainer ) ;
204199 expect ( tile . name ) . toEqual ( 'my-container' ) ;
205200 expect ( tile . title ) . toEqual ( 'my-container' ) ;
206201 expect ( tile . description ) . toBeUndefined ( ) ;
207202 } ) ;
208203} ) ;
209204
210205describe ( 'kameletToTile' , ( ) => {
211- it ( 'should return a tile with the correct type' , ( ) => {
206+ it ( 'should return a tile with the correct type' , async ( ) => {
212207 const kameletDef = {
213208 metadata : {
214209 name : 'my-kamelet' ,
@@ -227,14 +222,13 @@ describe('kameletToTile', () => {
227222 } ,
228223 } as IKameletDefinition ;
229224
230- const tile = kameletToTile ( kameletDef ) ;
225+ const tile = await kameletToTile ( kameletDef ) ;
231226
232- expect ( tile . type ) . toEqual ( CatalogKind . Kamelet ) ;
233227 expect ( tile . name ) . toEqual ( 'my-kamelet' ) ;
234228 expect ( tile . description ) . toEqual ( 'My Kamelet Description' ) ;
235229 } ) ;
236230
237- it ( 'should populate the tags for type' , ( ) => {
231+ it ( 'should populate the tags for type' , async ( ) => {
238232 const kameletDef = {
239233 metadata : {
240234 labels : {
@@ -250,12 +244,12 @@ describe('kameletToTile', () => {
250244 } ,
251245 } as IKameletDefinition ;
252246
253- const tile = kameletToTile ( kameletDef ) ;
247+ const tile = await kameletToTile ( kameletDef ) ;
254248
255249 expect ( tile . tags ) . toEqual ( [ 'source' ] ) ;
256250 } ) ;
257251
258- it ( 'should use the selected CatalogKind.Kamelet by default' , ( ) => {
252+ it ( 'should use the selected CatalogKind.Kamelet by default' , async ( ) => {
259253 const kameletDef = {
260254 metadata : {
261255 labels : {
@@ -271,12 +265,12 @@ describe('kameletToTile', () => {
271265 } ,
272266 } as IKameletDefinition ;
273267
274- const tile = kameletToTile ( kameletDef ) ;
268+ const tile = await kameletToTile ( kameletDef ) ;
275269
276270 expect ( tile . type ) . toEqual ( CatalogKind . Kamelet ) ;
277271 } ) ;
278272
279- it ( 'should populate the version for annotations' , ( ) => {
273+ it ( 'should populate the version for annotations' , async ( ) => {
280274 const kameletDef = {
281275 metadata : {
282276 labels : { } ,
@@ -292,12 +286,12 @@ describe('kameletToTile', () => {
292286 } ,
293287 } as IKameletDefinition ;
294288
295- const tile = kameletToTile ( kameletDef ) ;
289+ const tile = await kameletToTile ( kameletDef ) ;
296290
297291 expect ( tile . version ) . toEqual ( '1.0.0' ) ;
298292 } ) ;
299293
300- it ( 'should populate the headerTags' , ( ) => {
294+ it ( 'should populate the headerTags' , async ( ) => {
301295 const kameletDef = {
302296 metadata : {
303297 annotations : {
@@ -313,7 +307,7 @@ describe('kameletToTile', () => {
313307 } ,
314308 } as IKameletDefinition ;
315309
316- const tile = kameletToTile ( kameletDef ) ;
310+ const tile = await kameletToTile ( kameletDef ) ;
317311
318312 expect ( tile . headerTags ) . toEqual ( [ 'Kamelet' , 'Preview' ] ) ;
319313 } ) ;
0 commit comments