Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignite
GitHub Repository: ignite/cli
Path: blob/main/integration/single/cmd_singleton_test.go
1007 views
1
//go:build !relayer
2
3
package single_test
4
5
import (
6
"testing"
7
8
envtest "github.com/ignite/cli/v29/integration"
9
)
10
11
func TestCreateSingleton(t *testing.T) {
12
var (
13
env = envtest.New(t)
14
app = env.ScaffoldApp("github.com/test/blog")
15
servers = app.RandomizeServerPorts()
16
)
17
18
app.Scaffold(
19
"create an singleton type",
20
false,
21
"single",
22
"user", "email",
23
)
24
25
app.Scaffold(
26
"create an singleton type with custom path",
27
false,
28
"single",
29
"appPath", "email", "--path", app.SourcePath(),
30
)
31
32
app.Scaffold(
33
"create an singleton type with no message",
34
false,
35
"single",
36
"no-message", "email", "--no-message",
37
)
38
39
app.Scaffold(
40
"create a module",
41
false,
42
"module",
43
"example", "--require-registration",
44
)
45
46
app.Scaffold(
47
"create another type",
48
false,
49
"list",
50
"user", "email", "--module", "example",
51
)
52
53
app.Scaffold(
54
"create another type with a custom field type",
55
false,
56
"list",
57
"user-detail", "user:User", "--module", "example",
58
)
59
60
app.Scaffold(
61
"should prevent creating an singleton type with a typename that already exist",
62
true,
63
"single",
64
"user", "email", "--module", "example",
65
)
66
67
app.Scaffold(
68
"create an singleton type in a custom module",
69
false,
70
"single",
71
"singleuser", "email", "--module", "example",
72
)
73
74
app.EnsureSteady()
75
76
app.RunChainAndSimulateTxs(servers)
77
}
78
79