Test an App
Check the changed App behavior and finish the onboarding evidence.
Test an App
Run the generated Note authorization declaration test from the Core root after Create a Resource:
task test -- packages/workshop/tests/Feature/NoteAuthorizationTest.php --compact
task artisan -- nexia-apps:doctor-package-app workshopVerify
The named test actually executes and succeeds; the doctor has no FAIL. Add the behavioral checks below for the changed risk rather than treating those two results as full coverage.
The test asserts the Module's ownership and permission profile. The doctor checks package wiring. Neither proves that an HTTP write is authorized or persisted correctly.
Choose the smallest behavioral test
Keep tests in your App's tests/ directory. The scaffold declares extra.nexia.test_paths: ["tests"] and creates this package-local Pest binding:
use Tests\TestCase;
uses(TestCase::class)->in(__DIR__);| Change | Test through the real boundary |
|---|---|
| New category field | Authorized create/update round trip, null clearing, over-80-character rejection |
| Permission or ownership | Allowed actor, denied actor, other organization, other tenant; list and record agree |
| Migration | Existing rows survive; DB constraint rejects invalid writes |
| Event handler | Repeated delivery produces one effect; missing tenant and revoked authority fail safely |
| Initialization | Repeated repair produces the same row set |
Use a tenant fixture with Workshop operational before testing its endpoint. Otherwise app.installed:workshop can refuse the request before the Policy. Resolve SDK test-host contracts for host-owned state: Nexia\Testing\Contracts\ContributionTestHost, HostTestStore, or ApprovalTestHost as appropriate. Do not import host Eloquent models into App tests. Test-specific actor and installation fixture APIs are documented in SDK contracts.
A tenant-context helper does not automatically set the HTTP host; the request must target the tenant domain. Assert the intended endpoint status, including deliberate not-found responses that conceal out-of-scope records.
Run in the development container
task test -- packages/workshop/tests --sequential --compactThe wrapper resolves the database inside Docker. Host-shell Pest cannot resolve the postgres service; changing DB_HOST to work around that can select the wrong database. Use Fix test failures for tenant lifecycle, parallel bindings and template database issues. Missing test key on an older checkout can be repaired with task artisan -- key:generate --env=testing --ansi.
Run frontend tests only when they cover changed behavior, using the package path through the host's frontend tooling. Full task check belongs to an explicitly requested full gate or a develop → main promotion, not every edit.
For an App that has frontend test files, run only that App’s path from the Core root:
task frontend:test -- packages/workshop/resources/jsThe Note generator does not create frontend tests; an empty selection is not a passing test result.
Finish onboarding
Reuse evidence already collected for the same source state:
| Result | Evidence |
|---|---|
| Local host works | Quickstart doctor and tenant sign-in |
| Correct source is loaded | Composer-installed path matches your App root |
| Lifecycle works | Activation, targeted migration and tenant installation |
| Screen works | Create, list, Inspector, detail and edit a Note |
Inspect git status --short in Core and the App separately. Activation can add a workspace importer to Core's pnpm-lock.yaml; the ignored App directory does not guarantee an unchanged Core tree. Review those changes without discarding unrelated work. Do not rerun successful onboarding gates merely to collect a final success phrase.
For a release, continue with Release an App. Record the exact candidate commits and executed checks; an unexecuted test plan is not verification.