Some checks failed
Docs Deploy / build_and_deploy (push) Has been cancelled
Generate Docs / cli (push) Has been cancelled
Generate Config Doc / cli (push) Has been cancelled
Go formatting / go-formatting (push) Has been cancelled
Check links / markdown-link-check (push) Has been cancelled
Integration / pre-test (push) Has been cancelled
Integration / test on (push) Has been cancelled
Integration / status (push) Has been cancelled
Lint / Lint Go code (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
149 lines
2.7 KiB
Go
149 lines
2.7 KiB
Go
//go:build !relayer
|
|
|
|
package other_components_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
envtest "git.cw.tr/mukan-network/mukan-ignite/integration"
|
|
)
|
|
|
|
func TestGenerateAnAppWithMessage(t *testing.T) {
|
|
var (
|
|
env = envtest.New(t)
|
|
app = env.ScaffoldApp("github.com/test/blog")
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message",
|
|
false,
|
|
"message",
|
|
"do-foo",
|
|
"text",
|
|
"vote:int",
|
|
"like:bool",
|
|
"from:address",
|
|
"-r",
|
|
"foo,bar:int,foobar:bool",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with custom path",
|
|
false,
|
|
"message",
|
|
"app-path",
|
|
"text",
|
|
"vote:int",
|
|
"like:bool",
|
|
"-r",
|
|
"foo,bar:int,foobar:bool",
|
|
"--path",
|
|
"blog",
|
|
"--no-simulation",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating an existing message",
|
|
true,
|
|
"message", "do-foo", "bar",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a message whose name only differs in capitalization",
|
|
true,
|
|
"message", "do-Foo", "bar",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with a custom signer name",
|
|
false,
|
|
"message", "--yes", "do-bar", "bar", "--signer", "bar-doer",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a custom field type",
|
|
false,
|
|
"type",
|
|
"custom-type",
|
|
"numInt:int",
|
|
"numsInt:array.int",
|
|
"numsIntAlias:ints",
|
|
"numUint:uint",
|
|
"numsUint:array.uint",
|
|
"numsUintAlias:uints",
|
|
"textString:string",
|
|
"textStrings:array.string",
|
|
"textStringsAlias:strings",
|
|
"textCoin:coin",
|
|
"textCoins:array.coin",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a custom type with custom array field type",
|
|
false,
|
|
"type",
|
|
"custom-type-array",
|
|
"customFields:array.CustomType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a custom type with invalid custom array field type",
|
|
true,
|
|
"type",
|
|
"custom-type-invalid-array",
|
|
"customFields:array.UnknownType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with the custom field type",
|
|
false,
|
|
"message", "foo-baz", "customField:CustomType", "textCoinsAlias:coins",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with lowercase custom field type",
|
|
false,
|
|
"message", "foo-baz-lower", "customField:customType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with custom array field type",
|
|
false,
|
|
"message", "foo-baz-array", "customFields:array.CustomType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message with lowercase custom array field type",
|
|
false,
|
|
"message", "foo-baz-array-lower", "customFields:array.customType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a message with invalid custom array field type",
|
|
true,
|
|
"message", "foo-baz-invalid-array", "customFields:array.UnknownType",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a module",
|
|
false,
|
|
"module", "foo", "--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a message in a module",
|
|
false,
|
|
"message",
|
|
"do-foo",
|
|
"text",
|
|
"userIds:array.uint",
|
|
"--module",
|
|
"foo",
|
|
"--desc",
|
|
"foo bar foobar",
|
|
"--response",
|
|
"foo,bar:int,foobar:bool",
|
|
)
|
|
|
|
app.EnsureSteady()
|
|
}
|