@@ -35,7 +35,7 @@ describe('ERC721WithData - Unit Tests', async function () {
3535 it ( 'Create - Should create a new ERC721 instance with default state' , async function ( ) {
3636 expect ( await deployedERC721WithData . name ( ) ) . to . equal ( contractName ) ;
3737 expect ( await deployedERC721WithData . symbol ( ) ) . to . equal ( contractSymbol ) ;
38- expect ( await deployedERC721WithData . baseTokenUri ( ) ) . to . equal ( 'firefly://token/ ' ) ;
38+ expect ( await deployedERC721WithData . baseTokenUri ( ) ) . to . equal ( '' ) ;
3939 } ) ;
4040
4141 it ( 'Mint - Should mint successfully with a custom URI' , async function ( ) {
@@ -58,7 +58,7 @@ describe('ERC721WithData - Unit Tests', async function () {
5858 // Signer B mint token to Signer B (Not allowed)
5959 await expect (
6060 deployedERC721WithData . connect ( signerB ) . mintWithData ( signerB . address , '0x00' ) ,
61- ) . to . be . revertedWith ( 'Ownable: caller is not the owner ') ;
61+ ) . to . be . revertedWithCustomError ( deployedERC721WithData , 'OwnableUnauthorizedAccount ') ;
6262
6363 expect ( await deployedERC721WithData . balanceOf ( signerB . address ) ) . to . equal ( 0 ) ;
6464 } ) ;
@@ -73,7 +73,6 @@ describe('ERC721WithData - Unit Tests', async function () {
7373 . to . emit ( deployedERC721WithData , 'Transfer' )
7474 . withArgs ( ZERO_ADDRESS , deployerSignerA . address , 1 ) ;
7575 expect ( await deployedERC721WithData . balanceOf ( deployerSignerA . address ) ) . to . equal ( 1 ) ;
76- expect ( await deployedERC721WithData . tokenURI ( 1 ) ) . to . equal ( 'firefly://token/1' ) ;
7776 // Signer A transfer token to Signer B
7877 await expect (
7978 deployedERC721WithData
@@ -137,7 +136,7 @@ describe('ERC721WithData - Unit Tests', async function () {
137136 deployedERC721WithData
138137 . connect ( deployerSignerA )
139138 . transferWithData ( signerB . address , signerC . address , 1 , '0x00' ) ,
140- ) . to . be . revertedWith ( 'ERC721: caller is not token owner or approved ') ;
139+ ) . to . be . revertedWithCustomError ( deployedERC721WithData , 'ERC721InsufficientApproval ') ;
141140
142141 expect ( await deployedERC721WithData . balanceOf ( deployerSignerA . address ) ) . to . equal ( 0 ) ;
143142 expect ( await deployedERC721WithData . balanceOf ( signerB . address ) ) . to . equal ( 2 ) ;
@@ -248,36 +247,4 @@ describe('ERC721WithData - Unit Tests', async function () {
248247 expect ( await deployedERC721WithData . balanceOf ( signerB . address ) ) . to . equal ( 1 ) ;
249248 expect ( await deployedERC721WithData . balanceOf ( signerC . address ) ) . to . equal ( 1 ) ;
250249 } ) ;
251-
252- it ( "URI - Minted token URIs should be 'firefly://token/<tokenId>'" , async function ( ) {
253- expect ( await deployedERC721WithData . balanceOf ( deployerSignerA . address ) ) . to . equal ( 0 ) ;
254- expect ( await deployedERC721WithData . balanceOf ( signerB . address ) ) . to . equal ( 0 ) ;
255- expect ( await deployedERC721WithData . balanceOf ( signerC . address ) ) . to . equal ( 0 ) ;
256- // Signer A mints token to itself
257- await expect (
258- deployedERC721WithData . connect ( deployerSignerA ) . mintWithData ( deployerSignerA . address , '0x00' ) ,
259- )
260- . to . emit ( deployedERC721WithData , 'Transfer' )
261- . withArgs ( ZERO_ADDRESS , deployerSignerA . address , 1 ) ;
262- // Signer A mints token to Signer B
263- await expect (
264- deployedERC721WithData . connect ( deployerSignerA ) . mintWithData ( signerB . address , '0x00' ) ,
265- )
266- . to . emit ( deployedERC721WithData , 'Transfer' )
267- . withArgs ( ZERO_ADDRESS , signerB . address , 2 ) ;
268- // Signer A mints token to Signer C
269- await expect (
270- deployedERC721WithData . connect ( deployerSignerA ) . mintWithData ( signerC . address , '0x00' ) ,
271- )
272- . to . emit ( deployedERC721WithData , 'Transfer' )
273- . withArgs ( ZERO_ADDRESS , signerC . address , 3 ) ;
274-
275- expect ( await deployedERC721WithData . tokenURI ( 1 ) ) . to . equal ( 'firefly://token/1' ) ;
276- expect ( await deployedERC721WithData . tokenURI ( 2 ) ) . to . equal ( 'firefly://token/2' ) ;
277- expect ( await deployedERC721WithData . tokenURI ( 3 ) ) . to . equal ( 'firefly://token/3' ) ;
278-
279- expect ( await deployedERC721WithData . balanceOf ( deployerSignerA . address ) ) . to . equal ( 1 ) ;
280- expect ( await deployedERC721WithData . balanceOf ( signerB . address ) ) . to . equal ( 1 ) ;
281- expect ( await deployedERC721WithData . balanceOf ( signerC . address ) ) . to . equal ( 1 ) ;
282- } ) ;
283250} ) ;
0 commit comments