(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestHandleHook_NoColorDisablesOsc8(t *testing.T) { |
| 161 | t.Setenv("NO_COLOR", "1") |
| 162 | data := marshalHookData(t, hooks.Request{ |
| 163 | RootCmd: "compose logs", |
| 164 | }) |
| 165 | var buf bytes.Buffer |
| 166 | err := handleHook(t.Context(), []string{data}, &buf) |
| 167 | assert.NilError(t, err) |
| 168 | |
| 169 | msg := unmarshalResponse(t, buf.Bytes()) |
| 170 | // With NO_COLOR set, the hint should contain the plain URL without escape sequences |
| 171 | assert.Assert(t, strings.Contains(msg.Template, testDeepLink), "hint should contain the deep link URL") |
| 172 | assert.Assert(t, !strings.Contains(msg.Template, "\033"), "hint should not contain ANSI escape sequences") |
| 173 | } |
| 174 | |
| 175 | func TestHandleHook_AppIDEncodedInURL(t *testing.T) { |
| 176 | prev := resolveAppID |
nothing calls this directly
no test coverage detected