Skip to content

Commit

Permalink
fix test with users
Browse files Browse the repository at this point in the history
  • Loading branch information
DIGIX666 committed Oct 15, 2024
1 parent ba7aad3 commit 1a5c7d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions api/p/memeland/memeland_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

func TestPostMeme(t *testing.T) {
test1 := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
std.TestSetOrigCaller(test1)

m := NewMemeland()
id := m.PostMeme("Test meme data", time.Now().Unix())
if id == "" {
Expand Down Expand Up @@ -169,7 +172,8 @@ func TestGetPostsInRangeByUpvote(t *testing.T) {
}

func TestBadSortBy(t *testing.T) {

test1 := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5")
std.TestSetOrigCaller(test1)
m := NewMemeland()
now := time.Now()

Expand Down Expand Up @@ -233,6 +237,8 @@ func TestNoPosts(t *testing.T) {
}

func TestUpvote(t *testing.T) {
test1 := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5")
std.TestSetOrigCaller(test1)
m := NewMemeland()

// Add a post to Memeland
Expand Down Expand Up @@ -261,14 +267,14 @@ func TestUpvote(t *testing.T) {
}

func TestDelete(t *testing.T) {
alice := testutils.TestAddress("alice")
alice := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
std.TestSetOrigCaller(alice)

// Alice is admin
m := NewMemeland()

// Set caller to Bob
bob := testutils.TestAddress("bob")
bob := std.Address("g13ek2zz9qurzynzvssyc4sthwppnruhnp0gdz8n") // @r_demo
std.TestSetOrigCaller(bob)

// Bob adds post to Memeland
Expand All @@ -289,7 +295,7 @@ func TestDelete(t *testing.T) {
}

func TestDeleteByNonAdmin(t *testing.T) {
alice := testutils.TestAddress("alice")
alice := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
std.TestSetOrigCaller(alice)

m := NewMemeland()
Expand Down

0 comments on commit 1a5c7d1

Please sign in to comment.