-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove indentation from chain serve output to make it easier t…
…o properly copy and paste (#3522) * chore: remove identation from chain serve output to make it easier to properly copy and paste * refactor: accountview tests to follow tt patterns * fix: adding missing changelog for chain serve indentation changes * refactor: following naming convention on tests for account string Co-authored-by: Jerónimo Albi <[email protected]> --------- Co-authored-by: Derick Rentz <[email protected]> Co-authored-by: Jerónimo Albi <[email protected]> Co-authored-by: Danilo Pantani <[email protected]>
- Loading branch information
1 parent
7b93008
commit a991ee2
Showing
3 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package accountview_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/ignite/cli/ignite/pkg/cliui/view/accountview" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestAccountString(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
account accountview.Account | ||
want string | ||
}{ | ||
{ | ||
name: "new account (mnemonic available) to string is not idented", | ||
account: accountview.NewAccount("alice", "cosmos193he38n21khnmb2", accountview.WithMnemonic("person estate daughter box chimney clay bronze ring story truck make excess ring frame desk start food leader sleep predict item rifle stem boy")), | ||
want: "✔ Added account \x1b[1malice\x1b[0m with address cosmos193he38n21khnmb2 and mnemonic:\nperson estate daughter box chimney clay bronze ring story truck make excess ring frame desk start food leader sleep predict item rifle stem boy\n", | ||
}, | ||
{ | ||
name: "existent account to string is not idented", | ||
account: accountview.NewAccount("alice", "cosmos193he38n21khnmb2"), | ||
want: "👤 \x1b[1malice\x1b[0m's account address: cosmos193he38n21khnmb2\n", | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
result := tt.account.String() | ||
|
||
assert.NotEmpty(t, result) | ||
assert.Equal(t, tt.want, result) | ||
}) | ||
} | ||
} |