From 168690492352b8085ce1df4682839d6c69d360ee Mon Sep 17 00:00:00 2001 From: Samuel Vanderwaal Date: Fri, 14 Jul 2023 11:05:43 -0800 Subject: [PATCH] update JS tests --- token-metadata/js/test/burn.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/token-metadata/js/test/burn.test.ts b/token-metadata/js/test/burn.test.ts index 476a6a761b..a3ad383e04 100644 --- a/token-metadata/js/test/burn.test.ts +++ b/token-metadata/js/test/burn.test.ts @@ -37,12 +37,14 @@ test.only('Burn: NonFungible asset', async (t) => { await updateTx.assertSuccess(t); - // All three accounts are closed. Metadata account should have a data length of 0 but may be open if it contains fees. + // Metadata account should have a data length of 1 because it still contains fees. It's discriminator will be Unitialized. + // Edition and token accounts should be closed. const metadataAccount = await connection.getAccountInfo(metadata); const editionAccount = await connection.getAccountInfo(masterEdition); const tokenAccount = await connection.getAccountInfo(token); - t?.equal(metadataAccount.data.length, 0); + t?.equal(metadataAccount.data.length, 1); + t?.equal(metadataAccount.data[0], 0); t.equal(editionAccount, null); t.equal(tokenAccount, null); }); @@ -79,13 +81,15 @@ test('Burn: ProgrammableNonFungible asset', async (t) => { await updateTx.assertSuccess(t); - // All three accounts are closed. + // Metadata account should have a data length of 1 because it still contains fees. It's discriminator will be Unitialized. + // Edition, token, and token record accounts should be closed. const metadataAccount = await connection.getAccountInfo(metadata); const editionAccount = await connection.getAccountInfo(masterEdition); const tokenAccount = await connection.getAccountInfo(token); const tokenRecordAccount = await connection.getAccountInfo(tokenRecord); - t?.equal(metadataAccount.data.length, 0); + t?.equal(metadataAccount.data.length, 1); + t?.equal(metadataAccount.data[0], 0); t.equal(editionAccount, null); t.equal(tokenAccount, null); t.equal(tokenRecordAccount, null);