@@ -47,6 +47,23 @@ const apiMock = new AxiosMock(api);
47
47
48
48
describe ( 'Orders' , ( ) => {
49
49
it ( 'should be able to list the food' , async ( ) => {
50
+ const favorites = [
51
+ {
52
+ id : 2 ,
53
+ name : 'Veggie' ,
54
+ description :
55
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
56
+ price : '21.90' ,
57
+ category : 2 ,
58
+ image_url :
59
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
60
+ thumbnail_url :
61
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
62
+ } ,
63
+ ] ;
64
+
65
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
66
+
50
67
const item = {
51
68
id : 1 ,
52
69
name : 'Ao molho' ,
@@ -96,6 +113,23 @@ describe('Orders', () => {
96
113
} ) ;
97
114
98
115
it ( 'should be able to increment food quantity' , async ( ) => {
116
+ const favorites = [
117
+ {
118
+ id : 2 ,
119
+ name : 'Veggie' ,
120
+ description :
121
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
122
+ price : '21.90' ,
123
+ category : 2 ,
124
+ image_url :
125
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
126
+ thumbnail_url :
127
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
128
+ } ,
129
+ ] ;
130
+
131
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
132
+
99
133
const item = {
100
134
id : 1 ,
101
135
name : 'Ao molho' ,
@@ -151,6 +185,23 @@ describe('Orders', () => {
151
185
} ) ;
152
186
153
187
it ( 'should be able to decrement food quantity' , async ( ) => {
188
+ const favorites = [
189
+ {
190
+ id : 2 ,
191
+ name : 'Veggie' ,
192
+ description :
193
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
194
+ price : '21.90' ,
195
+ category : 2 ,
196
+ image_url :
197
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
198
+ thumbnail_url :
199
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
200
+ } ,
201
+ ] ;
202
+
203
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
204
+
154
205
const item = {
155
206
id : 1 ,
156
207
name : 'Ao molho' ,
@@ -224,6 +275,23 @@ describe('Orders', () => {
224
275
} ) ;
225
276
226
277
it ( 'should not be able to decrement food quantity below than 1' , async ( ) => {
278
+ const favorites = [
279
+ {
280
+ id : 2 ,
281
+ name : 'Veggie' ,
282
+ description :
283
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
284
+ price : '21.90' ,
285
+ category : 2 ,
286
+ image_url :
287
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
288
+ thumbnail_url :
289
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
290
+ } ,
291
+ ] ;
292
+
293
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
294
+
227
295
const item = {
228
296
id : 1 ,
229
297
name : 'Ao molho' ,
@@ -289,6 +357,23 @@ describe('Orders', () => {
289
357
} ) ;
290
358
291
359
it ( 'should be able to increment an extra item quantity' , async ( ) => {
360
+ const favorites = [
361
+ {
362
+ id : 2 ,
363
+ name : 'Veggie' ,
364
+ description :
365
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
366
+ price : '21.90' ,
367
+ category : 2 ,
368
+ image_url :
369
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
370
+ thumbnail_url :
371
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
372
+ } ,
373
+ ] ;
374
+
375
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
376
+
292
377
const item = {
293
378
id : 1 ,
294
379
name : 'Ao molho' ,
@@ -350,6 +435,23 @@ describe('Orders', () => {
350
435
} ) ;
351
436
352
437
it ( 'should be able to decrement an extra item quantity' , async ( ) => {
438
+ const favorites = [
439
+ {
440
+ id : 2 ,
441
+ name : 'Veggie' ,
442
+ description :
443
+ 'Macarrão com pimentão, ervilha e ervas finas colhidas no himalaia.' ,
444
+ price : '21.90' ,
445
+ category : 2 ,
446
+ image_url :
447
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-food/food2.png' ,
448
+ thumbnail_url :
449
+ 'https://storage.googleapis.com/golden-wind/bootcamp-gostack/desafio-gorestaurant-mobile/veggie.png' ,
450
+ } ,
451
+ ] ;
452
+
453
+ apiMock . onGet ( '/favorites' ) . reply ( 200 , favorites ) ;
454
+
353
455
const item = {
354
456
id : 1 ,
355
457
name : 'Ao molho' ,
0 commit comments