diff --git a/src/plugin-slots/MainAppSlot/MainAppSlot.test.jsx b/src/plugin-slots/MainAppSlot/MainAppSlot.test.jsx new file mode 100644 index 000000000..f5262d81e --- /dev/null +++ b/src/plugin-slots/MainAppSlot/MainAppSlot.test.jsx @@ -0,0 +1,29 @@ +import { PluginSlot } from '@openedx/frontend-plugin-framework'; +import { render } from '@testing-library/react'; + +import MainAppSlot from './index'; + +jest.mock('@openedx/frontend-plugin-framework', () => ({ + PluginSlot: jest.fn(() => null), +})); + +describe('MainAppSlot', () => { + it('renders without crashing', () => { + render(); + }); + + it('renders a PluginSlot component', () => { + render(); + expect(PluginSlot).toHaveBeenCalled(); + }); + + it('passes the correct id prop to PluginSlot', () => { + render(); + expect(PluginSlot).toHaveBeenCalledWith({ id: 'main_app_slot' }, {}); + }); + + it('does not render any children', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); +});