import { describe, expect, it } from 'vitest';
import { resolveEventSlugAfterUpdate } from '../eventFormNavigation';
import type { TenantEvent } from '../../api';

describe('resolveEventSlugAfterUpdate', () => {
  it('returns the updated slug when it changes', () => {
    const updated = { slug: 'updated-slug' } as TenantEvent;

    expect(resolveEventSlugAfterUpdate('original-slug', updated)).toBe('updated-slug');
  });

  it('keeps the current slug when it is unchanged', () => {
    const updated = { slug: 'original-slug' } as TenantEvent;

    expect(resolveEventSlugAfterUpdate('original-slug', updated)).toBe('original-slug');
  });
});
