MCPcopy Create free account
hub / github.com/algolia/cli / TestRunOpenCmd_DashboardTargetConfiguredApp

Function TestRunOpenCmd_DashboardTargetConfiguredApp

pkg/cmd/open/open_test.go:139–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func TestRunOpenCmd_DashboardTargetConfiguredApp(t *testing.T) {
140 io, _, _, _ := iostreams.Test()
141 io.SetStdoutTTY(true)
142 io.SetStdinTTY(true)
143
144 cfg := test.NewConfigStubWithProfiles([]*config.Profile{
145 {Name: "default", ApplicationID: "APP123", APIKey: "key", Default: true},
146 })
147
148 opts, opened, authed := newTestOptions(io, cfg)
149 opts.Shortcut = "billing"
150
151 err := runOpenCmd(opts)
152 require.NoError(t, err)
153 assert.True(t, *authed, "application pages require sign-in")
154 assert.Equal(
155 t,
156 "https://dashboard.algolia.com/account/billing/details?applicationId=APP123",
157 *opened,
158 )
159}
160
161func TestRunOpenCmd_DashboardTargetAppScoped(t *testing.T) {
162 io, _, _, _ := iostreams.Test()

Callers

nothing calls this directly

Calls 6

TestFunction · 0.92
newTestOptionsFunction · 0.85
runOpenCmdFunction · 0.85
SetStdoutTTYMethod · 0.80
SetStdinTTYMethod · 0.80

Tested by

no test coverage detected