import {
  describe,
  expect,
  it
} from 'vitest';
import { isTransientSignalingOutboundType } from './realtime.constants';

describe('isTransientSignalingOutboundType', () => {
  it('treats negotiation traffic as droppable during reconnect', () => {
    expect(isTransientSignalingOutboundType('ice_candidate')).toBe(true);
    expect(isTransientSignalingOutboundType('offer')).toBe(true);
    expect(isTransientSignalingOutboundType('answer')).toBe(true);
    expect(isTransientSignalingOutboundType('keepalive')).toBe(true);
    expect(isTransientSignalingOutboundType('status_update')).toBe(true);
  });

  it('keeps membership traffic as non-transient', () => {
    expect(isTransientSignalingOutboundType('identify')).toBe(false);
    expect(isTransientSignalingOutboundType('join_server')).toBe(false);
    expect(isTransientSignalingOutboundType(undefined)).toBe(false);
  });
});
