File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/assets-controllers/src Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,21 @@ describe('NftController', () => {
392392 expect ( callActionSpy ) . toHaveBeenCalledTimes ( 0 ) ;
393393 } ) ;
394394
395+ it ( 'should error if the call to isNftOwner fail' , async function ( ) {
396+ const { nftController } = setupController ( ) ;
397+ jest . spyOn ( nftController , 'isNftOwner' ) . mockRejectedValue ( 'Random error' ) ;
398+ try {
399+ await nftController . watchNft (
400+ ERC721_NFT ,
401+ ERC721 ,
402+ 'https://test-dapp.com' ,
403+ ) ;
404+ } catch ( err ) {
405+ // eslint-disable-next-line jest/no-conditional-expect
406+ expect ( err ) . toBe ( 'Random error' ) ;
407+ }
408+ } ) ;
409+
395410 it ( 'should error if the user does not own the suggested ERC1155 NFT' , async function ( ) {
396411 const { nftController, messenger } = setupController ( {
397412 getERC1155BalanceOf : jest . fn ( ) . mockImplementation ( ( ) => new BN ( 0 ) ) ,
You can’t perform that action at this time.
0 commit comments