Open-source content management system (CMS) built with Phoenix LiveView. Faster render times to boost SEO performance, even for the most content-heavy pages.
Add Beacon.Testing to solve some pain points with testing Beacon resources and pages:
Creating resources
Move Beacon.Fixtures to lib/beacon/testing/fixtures.ex and make it public as Beacon.Testing.Fixtures. That module should be imported on use Beacon.Testing
Creating and Reloading resources
Currently to test pages and any other resources we need to first create the resource in the database and then load that resource into memory (load the Elixir module), eg:
If one tries to call that component without calling reload_components_module it fails since the module that provides that components has not been loaded. So at this point we have 2 options: call reload automatically after each fixture is executed (pages, layouts, components, live data, etc) or let users call reload manually as needed.
Calling automatically works for most cases but not always so we need to introduce a testing mode that is either :automatic or :manual that will call the respective reload functions or not.
Loading global required module
Routes and Components modules are global, ie: most of the other modules depend on it and thus should be eagerly loaded once before tests are executed.
Add
Beacon.Testing
to solve some pain points with testing Beacon resources and pages:Creating resources
Move
Beacon.Fixtures
tolib/beacon/testing/fixtures.ex
and make it public asBeacon.Testing.Fixtures
. That module should be imported onuse Beacon.Testing
Creating and Reloading resources
Currently to test pages and any other resources we need to first create the resource in the database and then load that resource into memory (load the Elixir module), eg:
If one tries to call that component without calling
reload_components_module
it fails since the module that provides that components has not been loaded. So at this point we have 2 options: callreload
automatically after each fixture is executed (pages, layouts, components, live data, etc) or let users callreload
manually as needed.Calling automatically works for most cases but not always so we need to introduce a testing mode that is either
:automatic
or:manual
that will call the respective reload functions or not.Loading global required module
Routes and Components modules are global, ie: most of the other modules depend on it and thus should be eagerly loaded once before tests are executed.