package handlers

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestParseTokenUUID_ValidUUID(t *testing.T) {
	validUUID := "550e8400-e29b-41d4-a716-446655440000"

	result, err := parseTokenUUID(validUUID)

	require.NoError(t, err)
	assert.True(t, result.Valid)
}

func TestParseTokenUUID_InvalidUUID(t *testing.T) {
	tests := []struct {
		name  string
		input string
	}{
		{"not a uuid", "not-a-valid-jwt-token"},
		{"empty string", ""},
		{"invalid format", "550e8400-e29b-41d4"},
		{"too short", "abc"},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			_, err := parseTokenUUID(tt.input)
			assert.Error(t, err)
		})
	}
}
