import { describe, it, expect, beforeEach } from 'vitest';
import { gradientShift } from './gradient-shift.js';
import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';

describe('gradient-shift', () => {
  beforeEach(resetDOM);

  it('connect sets data-gradient-shift-active', () => {
    const host = mountHost();
    connectTrait(gradientShift, host);
    expect(host.hasAttribute('data-gradient-shift-active')).toBe(true);
  });

  it('disconnect clears active + reverts inline styles', () => {
    const host = mountHost();
    const inst = connectTrait(gradientShift, host);
    inst.disconnect(host);
    expect(host.hasAttribute('data-gradient-shift-active')).toBe(false);
    expect(host.style.animation).toBe('');
    expect(host.style.backgroundSize).toBe('');
  });
});
