package jobs

import (
	"context"
	"errors"
	"testing"

	"github.com/riverqueue/river/rivertype"
)

func TestSlogErrorHandler_HandleError(t *testing.T) {
	h := &SlogErrorHandler{}
	job := &rivertype.JobRow{
		ID:          1,
		Kind:        "test_job",
		Attempt:     1,
		MaxAttempts: 3,
	}
	result := h.HandleError(context.Background(), job, errors.New("test error"))
	if result != nil {
		t.Errorf("HandleError returned %v, want nil", result)
	}
}

func TestSlogErrorHandler_HandlePanic(t *testing.T) {
	h := &SlogErrorHandler{}
	job := &rivertype.JobRow{
		ID:   2,
		Kind: "test_job",
	}
	result := h.HandlePanic(context.Background(), job, "panic value", "goroutine 1 ...")
	if result != nil {
		t.Errorf("HandlePanic returned %v, want nil", result)
	}
}
