import { describe, it, expect } from 'vitest'; import { readFileSync } from 'fs'; import path from 'path'; // Regression guard for the sidebar folder context-menu layout: the two refresh // actions (scan this folder, check for updates) sit on top, the folder // operations form a single group, and the destructive entry stays last behind // its own divider. SidebarManager gates those groups per page and collapses the // dividers when a group is hidden, so a reorder here also changes what the // recipes page shows. describe('Sidebar folder context menu layout', () => { const repoRoot = path.resolve(__dirname, '../../..'); const html = readFileSync( path.join(repoRoot, 'templates/components/context_menu.html'), 'utf-8' ); const menuHtml = html.slice( html.indexOf('id="sidebarFolderContextMenu"'), html.indexOf('') ); const sequence = [...menuHtml.matchAll(/