import React from 'react'; import { act, render, screen, waitFor } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import type { InstalledPlugin } from '@/lib/plugin-types'; // The app-page slot: a plugin's page at /apps//, inside the // app's own frame. const createSlotInstance = vi.fn((..._args: unknown[]) => ({ destroy: vi.fn(), updateProps: vi.fn(), setTheme: vi.fn() })); vi.mock('@/lib/plugin-sandbox/host-bridge', () => ({ createSlotInstance: (...args: unknown[]) => createSlotInstance(...args), })); vi.mock('@/lib/plugin-sandbox/host-theme', () => ({ snapshotHostTheme: () => ({}) })); vi.mock('@/components/layout/navigation-rail', () => ({ NavigationRail: ({ orientation }: { orientation?: string }) =>