Skip to main content
An add-on’s extension points are only proven by exercising them against the panel’s real routes, not by asserting against the add-on’s classes in isolation. The panel’s own test suite does this for its reference add-on, panel-addon-example, and the same pattern applies to any add-on.

The test case

Extend the panel’s base TestCase and add two things: the add-on’s service provider, so its Section actually registers, and the add-on’s Inertia page directory, so assertInertia() can resolve its page components.
Registering the provider through getPackageProviders() (rather than relying on auto-discovery) means the test boots the add-on exactly as a host app’s Composer autoloading would, with no shortcuts. Adding the page path is what lets assertInertia()->component('example-addon::Widgets/Index', false) resolve the add-on’s own Vue file for a “does this component exist on disk” check — pass false as the second argument where a component is registered at runtime via window.LunarPanel.registerPages() rather than served from a namespaced Blade view, since Inertia’s testing view-finder has no matching on-disk path to check for those.

A feature test

Use the fixture test case with Pest’s uses(), then hit both the add-on’s own routes and the real first-party routes it extends:
The first test proves the add-on’s own page renders and is permission-gated; the second and third prove the add-on’s table extension and slot actually appear on the real Customers pages, not merely in an isolated fixture — the same guarantee to check for a table column, a row action, a bulk action, a page action, a dashboard widget, or a search source. Non-Inertia surface (dashboard widgets, the search endpoint) is asserted the same way — through the real routes and PanelManager:

Running it

These tests live in the monorepo’s own panel test suite and run the same way any panel test does:
An add-on maintained outside the monorepo runs its own Testbench-based suite the same way, depending on lunarphp/panel and following the same TestCase pattern shown above.