package packspec

import (
	"testing"

	"github.com/nexuscrm/shared/pkg/constants"
	"github.com/stretchr/testify/assert"
)

func TestCompoundFieldComponents_LeadNameUsesMetadataOrder(t *testing.T) {
	assert.Equal(t,
		[]string{"Salutation", constants.FieldFirstName, constants.FieldLastName},
		CompoundFieldComponents("Lead", constants.FieldName),
	)
}

func TestCompoundFieldComponents_ContactNameUsesMetadataOrder(t *testing.T) {
	assert.Equal(t,
		[]string{"Salutation", constants.FieldFirstName, constants.FieldLastName},
		CompoundFieldComponents("Contact", constants.FieldName),
	)
}

func TestCompoundFieldComponents_UnknownObjectReturnsEmpty(t *testing.T) {
	assert.Empty(t, CompoundFieldComponents("Unknown__c", constants.FieldName))
}
