Something went wrong. Try again.
Comail's webmail client, based on Bulwark. Public source mirror
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344import { describe, it, expect, beforeEach } from 'vitest';import { exposePluginExternals, deactivatePlugin, isPluginActive, deactivateAllPlugins,} from '../plugin-loader';import { clearAllHooks, pluginErrorTracker } from '../plugin-hooks';
beforeEach(() => { clearAllHooks(); pluginErrorTracker.resetAll(); // eslint-disable-next-line @typescript-eslint/no-explicit-any delete (globalThis as any).__PLUGIN_EXTERNALS__;});
describe('exposePluginExternals', () => { it('is a no-op that does not publish globals (sandbox injects React per-iframe)', () => { exposePluginExternals(); // The blob-import loader that needed window.__PLUGIN_EXTERNALS__ is gone; // exposePluginExternals is kept only as a no-op for legacy callers. // eslint-disable-next-line @typescript-eslint/no-explicit-any expect((globalThis as any).__PLUGIN_EXTERNALS__).toBeUndefined(); });});
describe('isPluginActive', () => { it('returns false for unknown plugin', () => { expect(isPluginActive('nonexistent')).toBe(false); });});
describe('deactivatePlugin', () => { it('does nothing for unknown plugin (no error)', () => { expect(() => deactivatePlugin('nonexistent')).not.toThrow(); });});
describe('deactivateAllPlugins', () => { it('does not throw when no plugins active', () => { expect(() => deactivateAllPlugins()).not.toThrow(); });});