import { describe, it, expect } from 'vitest';
import { normalizePersonType } from '$lib/person/person-validation';

describe('edit load — SKIP → UNKNOWN normalization', () => {
	it('maps SKIP to UNKNOWN', () => {
		expect(normalizePersonType('SKIP')).toBe('UNKNOWN');
	});

	it('passes PERSON through unchanged', () => {
		expect(normalizePersonType('PERSON')).toBe('PERSON');
	});

	it('passes INSTITUTION through unchanged', () => {
		expect(normalizePersonType('INSTITUTION')).toBe('INSTITUTION');
	});

	it('passes GROUP through unchanged', () => {
		expect(normalizePersonType('GROUP')).toBe('GROUP');
	});

	it('passes UNKNOWN through unchanged', () => {
		expect(normalizePersonType('UNKNOWN')).toBe('UNKNOWN');
	});

	it('defaults null to PERSON', () => {
		expect(normalizePersonType(null)).toBe('PERSON');
	});
});
