Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignite
GitHub Repository: ignite/cli
Path: blob/main/integration/other_components/cmd_message_test.go
1007 views
1
//go:build !relayer
2
3
package other_components_test
4
5
import (
6
"testing"
7
8
envtest "github.com/ignite/cli/v29/integration"
9
)
10
11
func TestGenerateAnAppWithMessage(t *testing.T) {
12
var (
13
env = envtest.New(t)
14
app = env.ScaffoldApp("github.com/test/blog")
15
)
16
17
app.Scaffold(
18
"create a message",
19
false,
20
"message",
21
"do-foo",
22
"text",
23
"vote:int",
24
"like:bool",
25
"from:address",
26
"-r",
27
"foo,bar:int,foobar:bool",
28
)
29
30
app.Scaffold(
31
"create a message with custom path",
32
false,
33
"message",
34
"app-path",
35
"text",
36
"vote:int",
37
"like:bool",
38
"-r",
39
"foo,bar:int,foobar:bool",
40
"--path",
41
"blog",
42
"--no-simulation",
43
)
44
45
app.Scaffold(
46
"should prevent creating an existing message",
47
true,
48
"message", "do-foo", "bar",
49
)
50
51
app.Scaffold(
52
"should prevent creating a message whose name only differs in capitalization",
53
true,
54
"message", "do-Foo", "bar",
55
)
56
57
app.Scaffold(
58
"create a message with a custom signer name",
59
false,
60
"message", "--yes", "do-bar", "bar", "--signer", "bar-doer",
61
)
62
63
app.Scaffold(
64
"create a custom field type",
65
false,
66
"type",
67
"custom-type",
68
"numInt:int",
69
"numsInt:array.int",
70
"numsIntAlias:ints",
71
"numUint:uint",
72
"numsUint:array.uint",
73
"numsUintAlias:uints",
74
"textString:string",
75
"textStrings:array.string",
76
"textStringsAlias:strings",
77
"textCoin:coin",
78
"textCoins:array.coin",
79
)
80
81
app.Scaffold(
82
"create a message with the custom field type",
83
false,
84
"message", "foo-baz", "customField:CustomType", "textCoinsAlias:coins",
85
)
86
87
app.Scaffold(
88
"create a module",
89
false,
90
"module", "foo", "--require-registration",
91
)
92
93
app.Scaffold(
94
"create a message in a module",
95
false,
96
"message",
97
"do-foo",
98
"text",
99
"userIds:array.uint",
100
"--module",
101
"foo",
102
"--desc",
103
"foo bar foobar",
104
"--response",
105
"foo,bar:int,foobar:bool",
106
)
107
108
app.EnsureSteady()
109
}
110
111