mukan-ignite/integration/list/cmd_list_test.go
Mukan Erkin Törük c32551b6f7
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
refactor: replace all github.com upstream refs with git.cw.tr/mukan-network
2026-05-11 03:36:24 +03:00

178 lines
3 KiB
Go

//go:build !relayer
package list_test
import (
"testing"
envtest "git.cw.tr/mukan-network/mukan-ignite/integration"
)
func TestGenerateAnAppWithListAndVerify(t *testing.T) {
var (
env = envtest.New(t)
app = env.ScaffoldApp("github.com/test/blog")
servers = app.RandomizeServerPorts()
)
app.Scaffold(
"create a module",
false,
"module", "example", "--require-registration",
)
app.Scaffold(
"create a list",
false,
"list", "user", "email",
)
app.Scaffold(
"create a list with custom path and module",
false,
"list",
"AppPath",
"email",
"--path",
"blog",
"--module",
"example",
)
app.Scaffold(
"create a custom type fields",
false,
"list",
"employee",
"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",
"--no-simulation",
)
app.Scaffold(
"create a list with bool",
false,
"list",
"document",
"signed:bool",
"textCoinsAlias:coins",
"--module",
"example",
)
app.Scaffold(
"create a list with decimal coin",
false,
"list",
"decimal",
"deccointype:dec.coin",
"deccoins:dec.coins",
"--module",
"example",
)
app.Scaffold(
"create a list with custom field type",
false,
"list",
"custom",
"document:Document",
"--module",
"example",
)
app.Scaffold(
"create a list with lowercase custom field type",
false,
"list",
"custom-lower",
"document:document",
"--module",
"example",
)
app.Scaffold(
"create a list with custom array field type",
false,
"list",
"custom-array",
"documents:array.Document",
"--module",
"example",
)
app.Scaffold(
"create a list with lowercase custom array field type",
false,
"list",
"custom-array-lower",
"documents:array.document",
"--module",
"example",
)
app.Scaffold(
"should prevent creating a list with invalid custom array field type",
true,
"list",
"invalid-custom-array",
"documents:array.UnknownType",
"--module",
"example",
)
app.Scaffold(
"should prevent creating a list with duplicated fields",
true,
"list", "company", "name", "name",
)
app.Scaffold(
"should prevent creating a list with unrecognized field type",
true,
"list", "invalidField", "level:itn",
)
app.Scaffold(
"should prevent creating an existing list",
true,
"list", "user", "email",
)
app.Scaffold(
"should prevent creating a list whose name is a reserved word",
true,
"list", "map", "size:int",
)
app.Scaffold(
"should prevent creating a list containing a field with a reserved word",
true,
"list", "document", "type:int",
)
app.Scaffold(
"create a list with no interaction message",
false,
"list", "nomessage", "email", "--no-message",
)
app.Scaffold(
"should prevent creating a list in a non existent module",
true,
"list", "user", "email", "--module", "idontexist",
)
app.EnsureSteady()
app.RunChainAndSimulateTxs(servers)
}