Skip to content

Commit

Permalink
test: fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Dec 19, 2024
1 parent 53333f2 commit 44ae66b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions _deploy/r/gnoswap/gnft/gnft_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,12 @@ func TestSetTokenURI(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
std.TestSetRealm(tt.callerRealm)
_, err := SetTokenURI(tid(tt.tokenId))

if tt.shouldErr {
uassert.ErrorContains(t, SetTokenURI(tid(tt.tokenId)), tt.errMsg)
uassert.ErrorContains(t, err, tt.errMsg)
} else {
uassert.NoError(t, SetTokenURI(tid(tt.tokenId)))
uassert.NoError(t, err)
}
})
}
Expand Down Expand Up @@ -430,17 +431,13 @@ func TestSetTokenURILast(t *testing.T) {
resetObject(t)
std.TestSetRealm(positionRealm)
Mint(a2u(addr01), tid(1))
Mint(a2u(addr01), tid(2))
Mint(a2u(addr01), tid(2)) // last minted

t.Run("set token uri last", func(t *testing.T) {
std.TestSetRealm(addr01Realm)
SetTokenURILast()
})

t.Run("token uri(1)", func(t *testing.T) {
uassert.NotEmpty(t, TokenURI(tid(1)))
})

t.Run("token uri(2)", func(t *testing.T) {
uassert.NotEmpty(t, TokenURI(tid(2)))
})
Expand Down

0 comments on commit 44ae66b

Please sign in to comment.