import { describe, it, expect, beforeEach } from 'vitest';
import { dragGhost } from './drag-ghost.js';
import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';

describe('drag-ghost', () => {
  beforeEach(resetDOM);

  it('connect attaches without throwing', () => {
    const host = mountHost();
    expect(() => connectTrait(dragGhost, host)).not.toThrow();
  });

  it('disconnect clears the active attribute', () => {
    const host = mountHost();
    const inst = connectTrait(dragGhost, host);
    inst.disconnect(host);
    expect(host.hasAttribute('data-drag-ghost-active')).toBe(false);
  });
});
