import { describe, expect, it } from 'vitest';
import {
  getLatexVisualSlashCommandAt,
  getLatexVisualSlashCommands,
  getLatexVisualSlashGroups,
} from './latex-visual-slash-menu';

describe('R1 Visual slash command registry', () => {
  it('exposes /newline through the same menu registry used by typed slash and left +', () => {
    expect(getLatexVisualSlashCommands('newline')).toContain('newline');
    expect(getLatexVisualSlashCommands('hard break')).toContain('newline');
    const groupItems = getLatexVisualSlashGroups('line break').flatMap((group) => group.items);
    expect(groupItems.some((item) => item.id === 'newline')).toBe(true);
  });

  it('resolves the filtered newline command through keyboard selection', () => {
    expect(getLatexVisualSlashCommandAt('newline', 0)).toBe('newline');
  });
});
