import { render } from '@testing-library/vue';
import { describe, expect, test, beforeEach, afterEach, vi } from 'vitest';
import UiSidebarGroup from '../UiSidebarGroup.vue';
import {
  createSidebarShell,
  mockMatchMediaDesktop,
} from './sidebar-test-helpers';

beforeEach(() => mockMatchMediaDesktop());
afterEach(() => vi.restoreAllMocks());

describe('UiSidebarGroup', () => {
  test('applies pattern padding class to core group', () => {
    const { container } = render(
      createSidebarShell(
        `
        <UiSidebarGroup>
          <span data-testid="g">In</span>
        </UiSidebarGroup>
      `,
        { UiSidebarGroup },
      ),
    );
    const group = container.querySelector('[data-sidebar="group"]');
    expect(group?.className).toMatch(/p-2/);
    expect(container.querySelector('[data-testid="g"]')).toBeTruthy();
  });
});
