Path: blob/main/integration/other_components/cmd_query_test.go
1007 views
//go:build !relayer12package other_components_test34import (5"testing"67envtest "github.com/ignite/cli/v29/integration"8)910func TestGenerateAnAppWithQuery(t *testing.T) {11var (12env = envtest.New(t)13app = env.ScaffoldApp("github.com/test/blog")14)1516app.Scaffold(17"create a query",18false,19"query",20"foo",21"text",22"vote:int",23"like:bool",24"-r",25"foo,bar:int,foobar:bool",26)2728app.Scaffold(29"create a query with custom path",30false,31"query",32"AppPath",33"text",34"vote:int",35"like:bool",36"-r",37"foo,bar:int,foobar:bool",38"--path",39"./blog",40)4142app.Scaffold(43"create a paginated query",44false,45"query",46"bar",47"text",48"vote:int",49"like:bool",50"-r",51"foo,bar:int,foobar:bool",52"--paginated",53)5455app.Scaffold(56"create a custom field type",57false,58"type",59"custom-type",60"numInt:int",61"numsInt:array.int",62"numsIntAlias:ints",63"numUint:uint",64"numsUint:array.uint",65"numsUintAlias:uints",66"textString:string",67"textStrings:array.string",68"textStringsAlias:strings",69"textCoin:coin",70"textCoins:array.coin",71)7273app.Scaffold(74"create a query with the custom field type as a response",75false,76"query", "foobaz", "-r", "bar:CustomType",77)7879app.Scaffold(80"should prevent using custom type in request params",81true,82"query", "bur", "bar:CustomType",83)8485app.Scaffold(86"create an empty query",87false,88"query", "foobar",89)9091app.Scaffold(92"should prevent creating an existing query",93true,94"query", "foo", "bar",95)9697app.Scaffold(98"create a module",99false,100"module", "foo", "--require-registration",101)102103app.Scaffold(104"create a query in a module",105false,106"query",107"foo",108"text",109"--module",110"foo",111"--desc",112"foo bar foobar",113"--response",114"foo,bar:int,foobar:bool",115)116117app.EnsureSteady()118}119120121