(t *testing.T)
| 140 | } |
| 141 | |
| 142 | func TestHandleHook_HintContainsOSC8Link(t *testing.T) { |
| 143 | // Ensure ANSI is not suppressed by the test runner environment |
| 144 | t.Setenv("NO_COLOR", "") |
| 145 | t.Setenv("COMPOSE_ANSI", "") |
| 146 | data := marshalHookData(t, hooks.Request{ |
| 147 | RootCmd: "compose logs", |
| 148 | }) |
| 149 | var buf bytes.Buffer |
| 150 | err := handleHook(t.Context(), []string{data}, &buf) |
| 151 | assert.NilError(t, err) |
| 152 | |
| 153 | msg := unmarshalResponse(t, buf.Bytes()) |
| 154 | // Verify the template contains the OSC 8 hyperlink sequence |
| 155 | wantLink := formatter.OSC8Link(testDeepLink, testDeepLink) |
| 156 | assert.Assert(t, len(wantLink) > len(testDeepLink), "OSC8Link should wrap the URL with escape sequences") |
| 157 | assert.Assert(t, strings.Contains(msg.Template, wantLink), "hint should contain OSC 8 hyperlink") |
| 158 | } |
| 159 | |
| 160 | func TestHandleHook_NoColorDisablesOsc8(t *testing.T) { |
| 161 | t.Setenv("NO_COLOR", "1") |
nothing calls this directly
no test coverage detected