MCPcopy Create free account
hub / github.com/auth0/auth0-cli / TestAppsCreateCmd

Function TestAppsCreateCmd

internal/cli/apps_test.go:93–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestAppsCreateCmd(t *testing.T) {
94 tests := []struct {
95 name string
96 args []string
97 expectedError string
98 }{
99 {
100 name: "Resource Server - resource-server-identifier is empty string",
101 args: []string{
102 "--name", "My Resource Server App",
103 "--type", "resource_server",
104 "--resource-server-identifier", "",
105 },
106 expectedError: "resource-server-identifier cannot be empty for resource_server app type",
107 },
108 {
109 name: "Resource Server - resource-server-identifier is whitespace only",
110 args: []string{
111 "--name", "My Resource Server App",
112 "--type", "resource_server",
113 "--resource-server-identifier", " ",
114 },
115 expectedError: "resource-server-identifier cannot be empty for resource_server app type",
116 },
117 {
118 name: "Resource Server - resource-server-identifier is tab/newline",
119 args: []string{
120 "--name", "My Resource Server App",
121 "--type", "resource_server",
122 "--resource-server-identifier", "\t\n",
123 },
124 expectedError: "resource-server-identifier cannot be empty for resource_server app type",
125 },
126 }
127
128 for _, test := range tests {
129 t.Run(test.name, func(t *testing.T) {
130 cli := &cli{}
131 cli.noInput = true // Non-interactive mode.
132 cmd := createAppCmd(cli)
133 cmd.SetArgs(test.args)
134 err := cmd.Execute()
135
136 assert.EqualError(t, err, test.expectedError)
137 })
138 }
139}
140
141func TestFormatAppSettingsPath(t *testing.T) {
142 assert.Empty(t, formatAppSettingsPath(""))

Callers

nothing calls this directly

Calls 1

createAppCmdFunction · 0.85

Tested by

no test coverage detected