Skip to content

Commit a45b5ae

Browse files
author
Yash Agrawal
committed
feat: minor fixes
1 parent 79033b8 commit a45b5ae

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/SBTProxy.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,22 @@ describe('SBTProxy', () => {
10471047
).to.be.revertedWith(
10481048
'TransparentUpgradeableProxy: admin cannot fallback to proxy target'
10491049
)
1050+
1051+
const uri = await sbt.tokenURI(1)
1052+
const uriInfo: string[] = uri.split(',')
1053+
expect(uriInfo[0]).to.equal('data:application/json;base64')
1054+
const decodedData = JSON.parse(
1055+
Buffer.from(uriInfo[1], 'base64').toString()
1056+
) as {
1057+
name: string
1058+
description: string
1059+
image: string
1060+
attributes: any[]
1061+
}
1062+
expect(decodedData.name).to.eq(metadata.name)
1063+
expect(decodedData.description).to.eq(metadata.description)
1064+
expect(decodedData.image).to.eq(metadata.tokenURIImage)
1065+
expect(decodedData.attributes.length).to.eq(0)
10501066
})
10511067

10521068
it('The setTokenURI function should function correctly for no attributes', async () => {

0 commit comments

Comments
 (0)