fetch_ml/tests/unit/api/ws_jobs_args_test.go
Jeremie Fraeys d8cc2a4efa
refactor: Migrate all test imports from api to api/ws package
Updated 6 test files to use proper api/ws package imports:

1. tests/e2e/websocket_e2e_test.go
   - api.NewWSHandler → ws.NewHandler

2. tests/e2e/wss_reverse_proxy_e2e_test.go
   - api.NewWSHandler → ws.NewHandler

3. tests/integration/ws_handler_integration_test.go
   - api.NewWSHandler → wspkg.NewHandler
   - api.Opcode* → wspkg.Opcode*

4. tests/integration/websocket_queue_integration_test.go
   - api.NewWSHandler → wspkg.NewHandler
   - api.Opcode* → wspkg.Opcode*

5. tests/unit/api/ws_test.go
   - api.NewWSHandler → wspkg.NewHandler
   - api.Opcode* → wspkg.Opcode*

6. tests/unit/api/ws_jobs_args_test.go
   - api.Opcode* → wspkg.Opcode*

Removed api/ws_compat.go shim as all tests now use proper imports.

Build status: Compiles successfully
2026-02-17 13:52:20 -05:00

20 lines
632 B
Go

//nolint:revive // Package name 'api' is appropriate for this test package
package api_test
import (
"testing"
wspkg "github.com/jfraeys/fetch_ml/internal/api/ws"
)
func TestWSHandlerNewQueueOpcodeExists(t *testing.T) {
if wspkg.OpcodeQueueJobWithNote != 0x1B {
t.Fatalf("expected OpcodeQueueJobWithNote to be 0x1B, got %d", wspkg.OpcodeQueueJobWithNote)
}
if wspkg.OpcodeAnnotateRun != 0x1C {
t.Fatalf("expected OpcodeAnnotateRun to be 0x1C, got %d", wspkg.OpcodeAnnotateRun)
}
if wspkg.OpcodeSetRunNarrative != 0x1D {
t.Fatalf("expected OpcodeSetRunNarrative to be 0x1D, got %d", wspkg.OpcodeSetRunNarrative)
}
}