package jobs

import (
	"context"
	"testing"

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

func TestHeartbeatWorker(t *testing.T) {
	w := &HeartbeatWorker{}
	job := &river.Job[HeartbeatArgs]{
		JobRow: &rivertype.JobRow{
			ID:      42,
			Attempt: 1,
		},
		Args: HeartbeatArgs{},
	}
	if err := w.Work(context.Background(), job); err != nil {
		t.Fatalf("HeartbeatWorker.Work returned unexpected error: %v", err)
	}
}

func TestHeartbeatArgs_Kind(t *testing.T) {
	if got := (HeartbeatArgs{}).Kind(); got != "heartbeat" {
		t.Errorf("HeartbeatArgs.Kind() = %q, want %q", got, "heartbeat")
	}
}
