@@ -28,6 +28,7 @@ import { Collection } from 'modules/collection/types'
2828import { MAX_ITEMS } from 'modules/collection/constants'
2929import { FromParam } from 'modules/location/types'
3030import { getMethodData } from 'modules/wallet/utils'
31+ import { getIsLinkedWearablesV2Enabled } from 'modules/features/selectors'
3132import { mockedItem , mockedItemContents , mockedLocalItem , mockedRemoteItem } from 'specs/item'
3233import { getCollections , getCollection } from 'modules/collection/selectors'
3334import { updateProgressSaveMultipleItems } from 'modules/ui/createMultipleItems/action'
@@ -141,7 +142,10 @@ describe('when handling the save item request action', () => {
141142
142143 it ( 'should put a saveItemFailure action with invalid character message' , ( ) => {
143144 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+ ] )
145149 . put ( saveItemFailure ( item , contents , 'Invalid character! The ":" is not allowed in names or descriptions' ) )
146150 . dispatch ( saveItemRequest ( item , contents ) )
147151 . run ( { silenceTimeout : true } )
@@ -156,7 +160,10 @@ describe('when handling the save item request action', () => {
156160
157161 it ( 'should put a saveItemFailure action with invalid character message' , ( ) => {
158162 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+ ] )
160167 . put ( saveItemFailure ( item , contents , 'Invalid character! The ":" is not allowed in names or descriptions' ) )
161168 . dispatch ( saveItemRequest ( item , contents ) )
162169 . run ( { silenceTimeout : true } )
@@ -174,6 +181,7 @@ describe('when handling the save item request action', () => {
174181 return expectSaga ( itemSaga , builderAPI , builderClient )
175182 . provide ( [
176183 [ select ( getItem , item . id ) , undefined ] ,
184+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
177185 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
178186 [ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
179187 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE + 1 ) ] ,
@@ -197,6 +205,7 @@ describe('when handling the save item request action', () => {
197205 return expectSaga ( itemSaga , builderAPI , builderClient )
198206 . provide ( [
199207 [ select ( getItem , item . id ) , undefined ] ,
208+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
200209 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
201210 [ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
202211 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_SKIN_FILE_SIZE + 1 ) ] ,
@@ -217,6 +226,7 @@ describe('when handling the save item request action', () => {
217226 return expectSaga ( itemSaga , builderAPI , builderClient )
218227 . provide ( [
219228 [ select ( getItem , item . id ) , undefined ] ,
229+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
220230 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
221231 [ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
222232 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_EMOTE_FILE_SIZE + 1 ) ] ,
@@ -233,6 +243,7 @@ describe('when handling the save item request action', () => {
233243 return expectSaga ( itemSaga , builderAPI , builderClient )
234244 . provide ( [
235245 [ select ( getItem , item . id ) , undefined ] ,
246+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
236247 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
237248 [ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
238249 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE ) ] ,
@@ -249,6 +260,7 @@ describe('when handling the save item request action', () => {
249260 return expectSaga ( itemSaga , builderAPI , builderClient )
250261 . provide ( [
251262 [ select ( getItem , item . id ) , undefined ] ,
263+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
252264 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
253265 [ matchers . call . fn ( generateCatalystImage ) , Promise . resolve ( { hash : 'someHash' , content : blob } ) ] ,
254266 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( MAX_WEARABLE_FILE_SIZE ) ] ,
@@ -289,6 +301,7 @@ describe('when handling the save item request action', () => {
289301 [ matchers . call . fn ( reHashOlderContents ) , { } ] ,
290302 [ select ( getItem , item . id ) , undefined ] ,
291303 [ select ( getCollection , collection . id ) , collection ] ,
304+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
292305 [ matchers . call . fn ( calculateModelFinalSize ) , Promise . resolve ( 1 ) ] ,
293306 [ matchers . call . fn ( calculateFileSize ) , 1 ]
294307 ] )
@@ -322,6 +335,7 @@ describe('when handling the save item request action', () => {
322335 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
323336 [ select ( getItem , item . id ) , undefined ] ,
324337 [ select ( getAddress ) , mockAddress ] ,
338+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
325339 [
326340 call ( generateCatalystImage , item , {
327341 thumbnail : contents [ THUMBNAIL_PATH ]
@@ -357,6 +371,7 @@ describe('when handling the save item request action', () => {
357371 [ getContext ( 'history' ) , { push : pushMock , location : { pathname : 'notTPdetailPage' } } ] ,
358372 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
359373 [ select ( getItem , item . id ) , undefined ] ,
374+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
360375 [ select ( getAddress ) , mockAddress ] ,
361376 [
362377 call ( generateCatalystImage , item , {
@@ -390,6 +405,7 @@ describe('when handling the save item request action', () => {
390405 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
391406 [ select ( getItem , item . id ) , undefined ] ,
392407 [ select ( getAddress ) , mockAddress ] ,
408+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
393409 [ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
394410 [ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
395411 [ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -424,6 +440,7 @@ describe('when handling the save item request action', () => {
424440 { ...item , contents : { ...item . contents , [ IMAGE_PATH ] : item . contents [ IMAGE_PATH ] } , rarity : Rarity . COMMON }
425441 ] ,
426442 [ select ( getAddress ) , mockAddress ] ,
443+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
427444 [
428445 call ( generateCatalystImage , item , {
429446 thumbnail : contents [ THUMBNAIL_PATH ]
@@ -459,6 +476,7 @@ describe('when handling the save item request action', () => {
459476 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
460477 [ select ( getItem , item . id ) , undefined ] ,
461478 [ select ( getAddress ) , mockAddress ] ,
479+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
462480 [ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
463481 [ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
464482 [ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -485,6 +503,7 @@ describe('when handling the save item request action', () => {
485503 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
486504 [ select ( getItem , item . id ) , undefined ] ,
487505 [ select ( getAddress ) , mockAddress ] ,
506+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
488507 [ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
489508 [ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
490509 [ call ( [ builderAPI , 'saveItem' ] , item , contents ) , Promise . resolve ( item ) ] ,
@@ -509,6 +528,7 @@ describe('when handling the save item request action', () => {
509528 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
510529 [ select ( getItem , item . id ) , undefined ] ,
511530 [ select ( getAddress ) , mockAddress ] ,
531+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
512532 [ call ( [ builderAPI , 'saveItem' ] , item , { } ) , Promise . resolve ( item ) ] ,
513533 [ put ( saveItemSuccess ( item , { } ) ) , undefined ]
514534 ] )
@@ -543,6 +563,7 @@ describe('when handling the save item request action', () => {
543563 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
544564 [ select ( getItem , item . id ) , item ] ,
545565 [ select ( getAddress ) , mockAddress ] ,
566+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
546567 [ call ( calculateModelFinalSize , itemContents , modelContents , builderAPI ) , Promise . resolve ( 1 ) ] ,
547568 [ call ( calculateFileSize , thumbnailContent ) , 1 ] ,
548569 [ call ( [ builderAPI , 'saveItem' ] , itemWithNewHashes , newContents ) , Promise . resolve ( itemWithNewHashes ) ] ,
@@ -579,7 +600,8 @@ describe('when handling the save item success action', () => {
579600 [ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
580601 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
581602 [ select ( getPaginationData , item . collectionId ! ) , paginationData ] ,
582- [ select ( getAddress ) , mockAddress ]
603+ [ select ( getAddress ) , mockAddress ] ,
604+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
583605 ] )
584606 . put ( fetchCollectionItemsRequest ( item . collectionId ! , { page : paginationData . currentPage , limit : paginationData . limit } ) )
585607 . dispatch ( saveItemSuccess ( item , contents ) )
@@ -598,7 +620,8 @@ describe('when handling the save item success action', () => {
598620 [ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
599621 [ select ( getOpenModals ) , { EditItemURNModal : true } ] ,
600622 [ select ( getPaginationData , item . collectionId ! ) , paginationData ] ,
601- [ select ( getAddress ) , mockAddress ]
623+ [ select ( getAddress ) , mockAddress ] ,
624+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
602625 ] )
603626 . dispatch ( saveItemSuccess ( item , contents ) )
604627 . run ( { silenceTimeout : true } )
@@ -614,7 +637,8 @@ describe('when handling the save item success action', () => {
614637 . provide ( [
615638 [ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . thirdPartyCollectionDetail ( item . collectionId ) } } ] ,
616639 [ select ( getOpenModals ) , { } ] ,
617- [ select ( getAddress ) , mockAddress ]
640+ [ select ( getAddress ) , mockAddress ] ,
641+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
618642 ] )
619643 . not . call . fn ( fetchCollectionItemsRequest )
620644 . dispatch ( saveItemSuccess ( item , { } , { onlySaveItem : true } ) )
@@ -649,7 +673,8 @@ describe('when handling the save item success action', () => {
649673 . provide ( [
650674 [ getContext ( 'history' ) , { push : pushMock , location : { pathname : locations . collectionDetail ( collection . id ) } } ] ,
651675 [ select ( getOpenModals ) , { CreateSingleItemModal : true } ] ,
652- [ select ( getAddress ) , mockAddress ]
676+ [ select ( getAddress ) , mockAddress ] ,
677+ [ select ( getIsLinkedWearablesV2Enabled ) , true ]
653678 ] )
654679 . dispatch ( saveItemSuccess ( item , { } ) )
655680 . run ( { silenceTimeout : true } )
@@ -788,6 +813,7 @@ describe('when handling the setPriceAndBeneficiaryRequest action', () => {
788813 [ select ( getItems ) , [ item ] ] ,
789814 [ select ( getCollections ) , [ collection ] ] ,
790815 [ call ( getChainIdByNetwork , Network . MATIC ) , ChainId . MATIC_MAINNET ] ,
816+ [ select ( getIsLinkedWearablesV2Enabled ) , true ] ,
791817 [ matchers . call . fn ( sendTransaction ) , Promise . resolve ( '0xhash' ) ]
792818 ] )
793819 . put ( setPriceAndBeneficiarySuccess ( { ...item , price, beneficiary } , ChainId . MATIC_MAINNET , '0xhash' ) )
0 commit comments