@@ -28,6 +28,7 @@ import { Collection } from 'modules/collection/types'
28
28
import { MAX_ITEMS } from 'modules/collection/constants'
29
29
import { FromParam } from 'modules/location/types'
30
30
import { getMethodData } from 'modules/wallet/utils'
31
+ import { getIsLinkedWearablesV2Enabled } from 'modules/features/selectors'
31
32
import { mockedItem , mockedItemContents , mockedLocalItem , mockedRemoteItem } from 'specs/item'
32
33
import { getCollections , getCollection } from 'modules/collection/selectors'
33
34
import { updateProgressSaveMultipleItems } from 'modules/ui/createMultipleItems/action'
@@ -141,7 +142,10 @@ describe('when handling the save item request action', () => {
141
142
142
143
it ( 'should put a saveItemFailure action with invalid character message' , ( ) => {
143
144
return expectSaga ( itemSaga , builderAPI , builderClient )
144
- . provide ( [ [ select ( getItem , item . id ) , undefined ] ] )
145
+ . provide ( [
146
+ [ select ( getItem , item . id ) , undefined ] ,
147
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
148
+ ] )
145
149
. put ( saveItemFailure ( item , contents , 'Invalid character! The ":" is not allowed in names or descriptions' ) )
146
150
. dispatch ( saveItemRequest ( item , contents ) )
147
151
. run ( { silenceTimeout : true } )
@@ -156,7 +160,10 @@ describe('when handling the save item request action', () => {
156
160
157
161
it ( 'should put a saveItemFailure action with invalid character message' , ( ) => {
158
162
return expectSaga ( itemSaga , builderAPI , builderClient )
159
- . provide ( [ [ select ( getItem , item . id ) , undefined ] ] )
163
+ . provide ( [
164
+ [ select ( getItem , item . id ) , undefined ] ,
165
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
166
+ ] )
160
167
. put ( saveItemFailure ( item , contents , 'Invalid character! The ":" is not allowed in names or descriptions' ) )
161
168
. dispatch ( saveItemRequest ( item , contents ) )
162
169
. run ( { silenceTimeout : true } )
@@ -174,6 +181,7 @@ describe('when handling the save item request action', () => {
174
181
return expectSaga ( itemSaga , builderAPI , builderClient )
175
182
. provide ( [
176
183
[ select ( getItem , item . id ) , undefined ] ,
184
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
177
185
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
178
186
[ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
179
187
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE + 1 ) ] ,
@@ -197,6 +205,7 @@ describe('when handling the save item request action', () => {
197
205
return expectSaga ( itemSaga , builderAPI , builderClient )
198
206
. provide ( [
199
207
[ select ( getItem , item . id ) , undefined ] ,
208
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
200
209
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
201
210
[ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
202
211
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_SKIN_FILE_SIZE + 1 ) ] ,
@@ -217,6 +226,7 @@ describe('when handling the save item request action', () => {
217
226
return expectSaga ( itemSaga , builderAPI , builderClient )
218
227
. provide ( [
219
228
[ select ( getItem , item . id ) , undefined ] ,
229
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
220
230
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
221
231
[ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
222
232
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_EMOTE_FILE_SIZE + 1 ) ] ,
@@ -233,6 +243,7 @@ describe('when handling the save item request action', () => {
233
243
return expectSaga ( itemSaga , builderAPI , builderClient )
234
244
. provide ( [
235
245
[ select ( getItem , item . id ) , undefined ] ,
246
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
236
247
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
237
248
[ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
238
249
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE ) ] ,
@@ -249,6 +260,7 @@ describe('when handling the save item request action', () => {
249
260
return expectSaga ( itemSaga , builderAPI , builderClient )
250
261
. provide ( [
251
262
[ select ( getItem , item . id ) , undefined ] ,
263
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
252
264
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
253
265
[ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
254
266
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE ) ] ,
@@ -289,6 +301,7 @@ describe('when handling the save item request action', () => {
289
301
[ matchers . call . fn ( reHashOlderContents ) , { } ] ,
290
302
[ select ( getItem , item . id ) , undefined ] ,
291
303
[ select ( getCollection , collection . id ) , collection ] ,
304
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
292
305
[ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( 1 ) ] ,
293
306
[ matchers . call . fn ( calculateFileSize ) , 1 ]
294
307
] )
@@ -322,6 +335,7 @@ describe('when handling the save item request action', () => {
322
335
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
323
336
[ select ( getItem , item . id ) , undefined ] ,
324
337
[ select ( getAddress ) , mockAddress ] ,
338
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
325
339
[
326
340
call ( generateCatalystImage , item , {
327
341
thumbnail : contents [ THUMBNAIL_PATH ]
@@ -357,6 +371,7 @@ describe('when handling the save item request action', () => {
357
371
[ getContext ( 'history' ) , { push : pushMock , location : { pathname : 'notTPdetailPage' } } ] ,
358
372
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
359
373
[ select ( getItem , item . id ) , undefined ] ,
374
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
360
375
[ select ( getAddress ) , mockAddress ] ,
361
376
[
362
377
call ( generateCatalystImage , item , {
@@ -390,6 +405,7 @@ describe('when handling the save item request action', () => {
390
405
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
391
406
[ select ( getItem , item . id ) , undefined ] ,
392
407
[ select ( getAddress ) , mockAddress ] ,
408
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
393
409
[ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
394
410
[ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
395
411
[ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -424,6 +440,7 @@ describe('when handling the save item request action', () => {
424
440
{ ...item , contents : { ...item . contents , [ IMAGE_PATH ] : item . contents [ IMAGE_PATH ] } , rarity : Rarity . COMMON }
425
441
] ,
426
442
[ select ( getAddress ) , mockAddress ] ,
443
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
427
444
[
428
445
call ( generateCatalystImage , item , {
429
446
thumbnail : contents [ THUMBNAIL_PATH ]
@@ -459,6 +476,7 @@ describe('when handling the save item request action', () => {
459
476
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
460
477
[ select ( getItem , item . id ) , undefined ] ,
461
478
[ select ( getAddress ) , mockAddress ] ,
479
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
462
480
[ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
463
481
[ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
464
482
[ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -485,6 +503,7 @@ describe('when handling the save item request action', () => {
485
503
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
486
504
[ select ( getItem , item . id ) , undefined ] ,
487
505
[ select ( getAddress ) , mockAddress ] ,
506
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
488
507
[ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
489
508
[ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
490
509
[ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -509,6 +528,7 @@ describe('when handling the save item request action', () => {
509
528
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
510
529
[ select ( getItem , item . id ) , undefined ] ,
511
530
[ select ( getAddress ) , mockAddress ] ,
531
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
512
532
[ call ( [ builderAPI , 'saveItem' ] , item , { } ) , Promise . resolve ( item ) ] ,
513
533
[ put ( saveItemSuccess ( item , { } ) ) , undefined ]
514
534
] )
@@ -543,6 +563,7 @@ describe('when handling the save item request action', () => {
543
563
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
544
564
[ select ( getItem , item . id ) , item ] ,
545
565
[ select ( getAddress ) , mockAddress ] ,
566
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
546
567
[ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
547
568
[ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
548
569
[ call ( [ builderAPI , 'saveItem' ] , itemWithNewHashes , newContents ) , Promise . resolve ( itemWithNewHashes ) ] ,
@@ -579,7 +600,8 @@ describe('when handling the save item success action', () => {
579
600
[ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
580
601
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
581
602
[ select ( getPaginationData , item . collectionId ! ) , paginationData ] ,
582
- [ select ( getAddress ) , mockAddress ]
603
+ [ select ( getAddress ) , mockAddress ] ,
604
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
583
605
] )
584
606
. put ( fetchCollectionItemsRequest ( item . collectionId ! , { page : paginationData . currentPage , limit : paginationData . limit } ) )
585
607
. dispatch ( saveItemSuccess ( item , contents ) )
@@ -598,7 +620,8 @@ describe('when handling the save item success action', () => {
598
620
[ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
599
621
[ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
600
622
[ select ( getPaginationData , item . collectionId ! ) , paginationData ] ,
601
- [ select ( getAddress ) , mockAddress ]
623
+ [ select ( getAddress ) , mockAddress ] ,
624
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
602
625
] )
603
626
. dispatch ( saveItemSuccess ( item , contents ) )
604
627
. run ( { silenceTimeout : true } )
@@ -614,7 +637,8 @@ describe('when handling the save item success action', () => {
614
637
. provide ( [
615
638
[ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
616
639
[ select ( getOpenModals ) , { } ] ,
617
- [ select ( getAddress ) , mockAddress ]
640
+ [ select ( getAddress ) , mockAddress ] ,
641
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
618
642
] )
619
643
. not . call . fn ( fetchCollectionItemsRequest )
620
644
. dispatch ( saveItemSuccess ( item , { } , { onlySaveItem : true } ) )
@@ -649,7 +673,8 @@ describe('when handling the save item success action', () => {
649
673
. provide ( [
650
674
[ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . collectionDetail ( collection . id ) } } ] ,
651
675
[ select ( getOpenModals ) , { CreateSingleItemModal : true } ] ,
652
- [ select ( getAddress ) , mockAddress ]
676
+ [ select ( getAddress ) , mockAddress ] ,
677
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
653
678
] )
654
679
. dispatch ( saveItemSuccess ( item , { } ) )
655
680
. run ( { silenceTimeout : true } )
@@ -788,6 +813,7 @@ describe('when handling the setPriceAndBeneficiaryRequest action', () => {
788
813
[ select ( getItems ) , [ item ] ] ,
789
814
[ select ( getCollections ) , [ collection ] ] ,
790
815
[ call ( getChainIdByNetwork , Network . MATIC ) , ChainId . MATIC_MAINNET ] ,
816
+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
791
817
[ matchers . call . fn ( sendTransaction ) , Promise . resolve ( '0xhash' ) ]
792
818
] )
793
819
. put ( setPriceAndBeneficiarySuccess ( { ...item , price, beneficiary } , ChainId . MATIC_MAINNET , '0xhash' ) )
0 commit comments