(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func 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 | |
| 161 | func TestRunOpenCmd_DashboardTargetAppScoped(t *testing.T) { |
| 162 | io, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected