(t *testing.T)
| 196 | } |
| 197 | |
| 198 | func TestHandleHook_DockerLogsIgnoresAppID(t *testing.T) { |
| 199 | // resolveAppID is not consulted for "logs" because that hint isn't |
| 200 | // resolveProject; assert the URL stays paramless even if a stub |
| 201 | // would otherwise return a value. |
| 202 | prev := resolveAppID |
| 203 | t.Cleanup(func() { resolveAppID = prev }) |
| 204 | resolveAppID = func(context.Context, map[string]string) string { |
| 205 | t.Fatalf("resolveAppID should not be called for docker logs") |
| 206 | return "" |
| 207 | } |
| 208 | |
| 209 | t.Setenv("NO_COLOR", "1") |
| 210 | data := marshalHookData(t, hooks.Request{RootCmd: "logs"}) |
| 211 | var buf bytes.Buffer |
| 212 | err := handleHook(t.Context(), []string{data}, &buf) |
| 213 | assert.NilError(t, err) |
| 214 | |
| 215 | msg := unmarshalResponse(t, buf.Bytes()) |
| 216 | assert.Assert(t, strings.Contains(msg.Template, testDeepLink), |
| 217 | "docker logs hint should contain the bare deep link") |
| 218 | assert.Assert(t, !strings.Contains(msg.Template, "?appId="), |
| 219 | "docker logs hint must not encode an appId") |
| 220 | } |
| 221 | |
| 222 | func TestHandleHook_FeatureFlagDisabledSuppressesHint(t *testing.T) { |
| 223 | prev := logsTabEnabled |
nothing calls this directly
no test coverage detected