Skip to content

Commit

Permalink
update JS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelvanderwaal committed Jul 14, 2023
1 parent eae6d7d commit 1686904
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions token-metadata/js/test/burn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1686904

Please sign in to comment.