Skip to content

Commit

Permalink
chore: add more tests for proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed May 5, 2024
1 parent 8bf31df commit 7f7b251
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/types/proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,22 @@ func TestProposalGetVotingTime(t *testing.T) {

assert.Equal(t, "1 hour 1 minute", proposal.GetTimeLeft(), "Wrong value!")
}

func TestProposalInVoting(t *testing.T) {
t.Parallel()

assert.True(t, Proposal{Status: ProposalStatusVoting}.IsInVoting())
assert.False(t, Proposal{Status: ProposalStatusPassed}.IsInVoting())
}

func TestProposalStatusSerialize(t *testing.T) {
t.Parallel()

assert.Equal(t, "🗳️Voting", Proposal{Status: ProposalStatusVoting}.SerializeStatus())
assert.Equal(t, "💸Deposit", Proposal{Status: ProposalStatusDeposit}.SerializeStatus())
assert.Equal(t, "🙌 Passed", Proposal{Status: ProposalStatusPassed}.SerializeStatus())
assert.Equal(t, "🙅‍Rejected", Proposal{Status: ProposalStatusRejected}.SerializeStatus())
assert.Equal(t, "🤦‍Failed", Proposal{Status: ProposalStatusFailed}.SerializeStatus())
assert.Equal(t, "test", Proposal{Status: ProposalStatus("test")}.SerializeStatus())

}

Check failure on line 37 in pkg/types/proposal_test.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary trailing newline (whitespace)

0 comments on commit 7f7b251

Please sign in to comment.