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

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

describe('UiSidebarPopoverMenuItem', () => {
  test('renders label and shortcut', () => {
    const { getByText } = render(
      createSidebarShell(
        '<UiSidebarPopoverMenuItem label="Rename" shortcut="⌘R" />',
        {
          UiSidebarPopoverMenuItem,
        },
      ),
    );
    expect(getByText('Rename')).toBeInTheDocument();
    expect(getByText('⌘R')).toBeInTheDocument();
  });
});
