import { describe, it, expect, beforeEach } from 'vitest';
import { noiseTexture } from './noise-texture.js';
import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';

describe('noise-texture', () => {
  beforeEach(resetDOM);

  it('connect sets data-noise-texture-active and appends an overlay', () => {
    const host = mountHost();
    connectTrait(noiseTexture, host);
    expect(host.hasAttribute('data-noise-texture-active')).toBe(true);
  });

  it('disconnect clears active + removes overlay', () => {
    const host = mountHost();
    const inst = connectTrait(noiseTexture, host);
    inst.disconnect(host);
    expect(host.hasAttribute('data-noise-texture-active')).toBe(false);
  });
});
