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

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

describe('UiSidebarFooter', () => {
  test('forwards to core SidebarFooter with data-sidebar', () => {
    const { container } = render(
      createSidebarShell(
        '<UiSidebarFooter data-testid="f">Foot</UiSidebarFooter>',
        {
          UiSidebarFooter,
        },
      ),
    );
    expect(container.querySelector('[data-testid="f"]')).toHaveAttribute(
      'data-sidebar',
      'footer',
    );
    expect(container).toHaveTextContent('Foot');
  });
});
