Reference
Test through the same contracts applications use
Use package test helpers, temporary databases, generated manifests, and focused component tests instead of replacing framework behavior with unrelated mocks.
Start with the smallest real boundary
Unit-test pure model behavior directly, use the collection and temporary database helpers for persistence, and add route or browser tests only when the behavior crosses those interfaces.
Generate the manifest in tests
Test setup should scan the objects under test and load consumed package manifests so decorators, inheritance, interfaces, and migrations behave as they do in the application build.
Test security decisions explicitly
Cover anonymous, permitted, denied, cross-tenant, sensitive-field, read-only-field, and agent-confirmation cases. A passing happy path is not evidence that the boundary fails closed.